Struct ptree::builder::TreeBuilder
source · [−]pub struct TreeBuilder { /* private fields */ }
Expand description
A builder for a tree of StringItem
s
Implementations
sourceimpl TreeBuilder
impl TreeBuilder
sourcepub fn new(text: String) -> TreeBuilder
pub fn new(text: String) -> TreeBuilder
Start building a tree
The text
argument will be the top level item’s text.
sourcepub fn begin_child(&mut self, text: String) -> &mut Self
pub fn begin_child(&mut self, text: String) -> &mut Self
Add a child to the current item and make the new child current
sourcepub fn end_child(&mut self) -> &mut Self
pub fn end_child(&mut self) -> &mut Self
Finish adding children, and make the current item’s parent current
sourcepub fn add_empty_child(&mut self, text: String) -> &mut Self
pub fn add_empty_child(&mut self, text: String) -> &mut Self
Add an empty child (leaf item) to the current item
sourcepub fn build(&mut self) -> StringItem
pub fn build(&mut self) -> StringItem
Finish building the tree and return the top level item
Auto Trait Implementations
impl RefUnwindSafe for TreeBuilder
impl Send for TreeBuilder
impl Sync for TreeBuilder
impl Unpin for TreeBuilder
impl UnwindSafe for TreeBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more