zesterer / ariadne

A fancy diagnostics & error reporting crate
https://crates.io/crates/ariadne
MIT License
1.79k stars 78 forks source link

Feature Request: Getters of private fields #122

Open tnthung opened 4 months ago

tnthung commented 4 months ago

Many types ariadne provided is fully private with their fields, but there's no reason to obfuscate the parts of them. Such as kind, code, etc. from type Report, or span from Label. Getting those values will not affect the work of them, but hiding them would loss many possible opportunities.

Currently I'm working on a project which required some form of wrappers to reduce the boilerplate, one of problem I encounter is the lack of ability to access the span field from Label & unable to retrieve the labels of a Report, which stopped me from automatically generate the list of sources one report required. It's fine to do it manually, but that will make the code way more error-prone.

Maybe make them accessible? Either via pub the fields or some dedicated getter methods for them would be a wonderful thing to have. Appreciate the amazing work of yours.