pub struct TreeBuilder { /* private fields */ }Expand description
A builder for creating tree-structured output.
Implementations§
Source§impl TreeBuilder
impl TreeBuilder
Sourcepub fn with_options(options: DumpOptions) -> Self
pub fn with_options(options: DumpOptions) -> Self
Create a new tree builder with options.
Sourcepub fn options(&self) -> &DumpOptions
pub fn options(&self) -> &DumpOptions
Get the dump options.
Sourcepub fn begin_node(&mut self, title: &str)
pub fn begin_node(&mut self, title: &str)
Add a node with a title (creates a branch point).
Sourcepub fn add_leaf(&mut self, title: &str, props: &[(&str, String)])
pub fn add_leaf(&mut self, title: &str, props: &[(&str, String)])
Add a leaf node with properties.
Sourcepub fn add_leaf_with_params(
&mut self,
title: &str,
props: &[(&str, String)],
params: Option<&ParameterCollection>,
)
pub fn add_leaf_with_params( &mut self, title: &str, props: &[(&str, String)], params: Option<&ParameterCollection>, )
Add a leaf node with properties and optional params (for –show-keys debug).
When show_keys option is enabled, dumps all parameters from the collection.
Otherwise behaves like add_leaf.
Trait Implementations§
Source§impl Default for TreeBuilder
impl Default for TreeBuilder
Source§fn default() -> TreeBuilder
fn default() -> TreeBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TreeBuilder
impl RefUnwindSafe for TreeBuilder
impl Send for TreeBuilder
impl Sync for TreeBuilder
impl Unpin for TreeBuilder
impl UnwindSafe for TreeBuilder
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