collections::fmt::Debug
Trait collections::fmt::Debug
#[lang = "debug_trait"] pub trait Debug { fn fmt(&self, f: &mut Formatter) -> Result<(), Error>; }
Format trait for the ?
character.
Debug
should format the output in a programmer-facing, debugging context.
Generally speaking, you should just derive
a Debug
implementation.
When used with the alternate format specifier #?
, the output is pretty-printed.
For more information on formatters, see the module-level documentation.
This trait can be used with #[derive]
if all fields implement Debug
. When derive
d for structs, it will use the name of the struct
, then {
, then a comma-separated list of each field's name and Debug
value, then }