pub struct DepthPrinter<W: Write> { /* private fields */ }Expand description
Helper for printing ‘dump’ style information at different depths (i.e. with space prefixes).
This type is not thread safe.
Implementations§
Source§impl<W: Write> DepthPrinter<W>
impl<W: Write> DepthPrinter<W>
Sourcepub fn new(writer: W, depth: usize) -> Self
pub fn new(writer: W, depth: usize) -> Self
Creates a printer emitting items at depth to writer.
Sourcepub fn emit(&mut self, args: Arguments<'_>)
pub fn emit(&mut self, args: Arguments<'_>)
Emit a single item. It will have spaces prefixed based on the depth and a newline added to the end.
Use the emit! macro to construct the [core::fmt::Arguments] and emit an item in one
step.
Sourcepub fn begin_list(&mut self, max: usize)
pub fn begin_list(&mut self, max: usize)
Indicates a list is about to be emitted. Only at most max emit calls will result in
output, with any additional being counted. DepthPrinter::end_list must be called once
finished emitting the list.
Trait Implementations§
Source§impl<W: Write> Drop for DepthPrinter<W>
impl<W: Write> Drop for DepthPrinter<W>
Auto Trait Implementations§
impl<W> Freeze for DepthPrinter<W>where
W: Freeze,
impl<W> RefUnwindSafe for DepthPrinter<W>where
W: RefUnwindSafe,
impl<W> Send for DepthPrinter<W>where
W: Send,
impl<W> Sync for DepthPrinter<W>where
W: Sync,
impl<W> Unpin for DepthPrinter<W>where
W: Unpin,
impl<W> UnsafeUnpin for DepthPrinter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for DepthPrinter<W>where
W: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Init<T> for T
impl<T> Init<T> for T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
§impl<T> ToMutPtr for Twhere
T: ?Sized,
impl<T> ToMutPtr for Twhere
T: ?Sized,
§fn to_mut_ptr(&self) -> *mut T
fn to_mut_ptr(&self) -> *mut T
Casts the reference to a mutable raw pointer.