Struct webrender::print_tree::PrintTree
source · pub struct PrintTree<W>where
W: Write,{
level: u32,
queued_item: Option<String>,
line_buffer: String,
sink: W,
}
Expand description
A struct that makes it easier to print out a pretty tree of data, which can be visually scanned more easily.
Fields§
§level: u32
The current level of recursion.
queued_item: Option<String>
An item which is queued up, so that we can determine if we need a mid-tree prefix or a branch ending prefix.
line_buffer: String
§sink: W
The sink to print to.
Implementations§
source§impl<W> PrintTree<W>where
W: Write,
impl<W> PrintTree<W>where
W: Write,
pub fn new_with_sink(title: &str, sink: W) -> Self
fn print_level_prefix(&mut self)
fn flush_queued_item(&mut self, prefix: &str)
fn flush_line(&mut self)
Trait Implementations§
source§impl<W> PrintTreePrinter for PrintTree<W>where
W: Write,
impl<W> PrintTreePrinter for PrintTree<W>where
W: Write,
Auto Trait Implementations§
impl<W> Freeze for PrintTree<W>where
W: Freeze,
impl<W> RefUnwindSafe for PrintTree<W>where
W: RefUnwindSafe,
impl<W> Send for PrintTree<W>where
W: Send,
impl<W> Sync for PrintTree<W>where
W: Sync,
impl<W> Unpin for PrintTree<W>where
W: Unpin,
impl<W> UnwindSafe for PrintTree<W>where
W: UnwindSafe,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more