std::fmt::Debug

Trait std::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 .html?lang=en#[derive] if all fields implement Debug. When derived 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 }. For 登录查看完整内容