pub struct TreeFormatter { /* private fields */ }Expand description
Formats inspected values as tree structures.
Implementations§
Source§impl TreeFormatter
impl TreeFormatter
Sourcepub fn new() -> TreeFormatter
pub fn new() -> TreeFormatter
Create a new tree formatter with default configuration.
Sourcepub fn with_config(config: TreeConfig) -> TreeFormatter
pub fn with_config(config: TreeConfig) -> TreeFormatter
Create a tree formatter with specific configuration.
Sourcepub fn format(&mut self, value: &ValueRef<'_>) -> String
pub fn format(&mut self, value: &ValueRef<'_>) -> String
Format an inspected value to a String, automatically resolving color choice
based on stdout TTY and environment variables.
Sourcepub fn format_colored(&mut self, value: &ValueRef<'_>) -> String
pub fn format_colored(&mut self, value: &ValueRef<'_>) -> String
Format an inspected value with ANSI colors explicitly enabled.
Sourcepub fn format_plain(&mut self, value: &ValueRef<'_>) -> String
pub fn format_plain(&mut self, value: &ValueRef<'_>) -> String
Format an inspected value with ANSI colors explicitly disabled.
Sourcepub fn format_to<W>(
&mut self,
value: &ValueRef<'_>,
writer: &mut W,
) -> Result<(), Error>where
W: Write,
pub fn format_to<W>(
&mut self,
value: &ValueRef<'_>,
writer: &mut W,
) -> Result<(), Error>where
W: Write,
Format an inspected value directly to a std::fmt::Write destination.
Trait Implementations§
Source§impl Default for TreeFormatter
impl Default for TreeFormatter
Source§fn default() -> TreeFormatter
fn default() -> TreeFormatter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TreeFormatter
impl RefUnwindSafe for TreeFormatter
impl Send for TreeFormatter
impl Sync for TreeFormatter
impl Unpin for TreeFormatter
impl UnsafeUnpin for TreeFormatter
impl UnwindSafe for TreeFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more