Struct base::print_tree::PrintTree
source · pub struct PrintTree {
level: u32,
queued_item: Option<String>,
}
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.
Implementations§
source§impl PrintTree
impl PrintTree
pub fn new(title: String) -> PrintTree
sourcepub fn new_level(&mut self, queued_title: String)
pub fn new_level(&mut self, queued_title: String)
Descend one level in the tree with the given title string.
fn print_level_prefix(&self)
fn print_level_child_indentation(&self)
fn flush_queued_item(&mut self, prefix: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrintTree
impl RefUnwindSafe for PrintTree
impl Send for PrintTree
impl Sync for PrintTree
impl Unpin for PrintTree
impl UnwindSafe for PrintTree
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert