pub struct TreeFormatter { /* private fields */ }Expand description
Formats inspected values as tree structures.
Implementations§
Source§impl TreeFormatter
impl TreeFormatter
Sourcepub fn with_config(config: TreeConfig) -> Self
pub fn with_config(config: TreeConfig) -> Self
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: Write>(
&mut self,
value: &ValueRef<'_>,
writer: &mut W,
) -> Result
pub fn format_to<W: Write>( &mut self, value: &ValueRef<'_>, writer: &mut W, ) -> Result
Format an inspected value directly to a std::fmt::Write destination.
Trait Implementations§
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