[][src]Struct ptree::builder::TreeBuilder

pub struct TreeBuilder { /* fields omitted */ }

A builder for a tree of StringItems

Implementations

impl TreeBuilder[src]

pub fn new(text: String) -> TreeBuilder[src]

Start building a tree

The text argument will be the top level item's text.

pub fn begin_child(&mut self, text: String) -> &mut Self[src]

Add a child to the current item and make the new child current

pub fn end_child(&mut self) -> &mut Self[src]

Finish adding children, and make the current item's parent current

pub fn add_empty_child(&mut self, text: String) -> &mut Self[src]

Add an empty child (leaf item) to the current item

pub fn build(&mut self) -> StringItem[src]

Finish building the tree and return the top level item

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.