Expand description
Code for displaying reflected values in a consistent, human-readable format.
Primarily useful for interactive workflows, such as inspecting reflected values in a text-based format, or logging them to the console. Because the output is pure text, it is particularly useful for automated inspection, println!-debugging, and as output for screen readers.
Be mindful: these Display implementations return the full type path for each contained type.
While useful for detailed inspection, it can be unhelpfully verbose, especially for nested values.
To recursively collapse all contained type paths to their “short names” (i.e. with no crate/module paths),
use disqualified::ShortName::from on the returned String,
then use the Display implementation on ShortName for more concise output.
These implementations are stored in their own module rather than beside the types themselves to help ensure consistency and reduce clutter.
Note that these implementations are for the trait objects (dyn Struct, etc.) rather than for every T: Struct.
This is deliberate: it reduces the compile time and binary costs
associated with generating this code for every type that implements Reflect.
To use them with a concrete type, cast your value to a trait object before formatting it:
e.g. format!("{}", &my_value as &dyn Reflect).