Struct flange_flat_tree::Builder
source · [−]pub struct Builder<A> { /* private fields */ }
Expand description
Example:
use flange_flat_tree::Builder;
use flange_flat_tree::Tree;
use flange_flat_tree::Subtree;
let mut b = Builder::new();
b.start_element("root");
b.start_end_element("first_child");
b.start_element("second_child_with_children");
b.start_end_element("deep_child");
b.end_element();
b.end_element();
let tree = b.build();
assert_eq!(tree.root().value(), &"root");
assert_eq!(tree.root().children()[0].value(), &"first_child");
assert_eq!(tree.root().children()[1].children()[0].value(), &"deep_child");
Implementations
sourceimpl<A> Builder<A>
impl<A> Builder<A>
pub fn new() -> Builder<A>
pub fn with_capacity(c: usize) -> Builder<A>
pub fn get(&self, index: usize) -> Option<&A>
pub fn get_mut(&mut self, index: usize) -> Option<&mut A>
pub fn start_element(&mut self, el: A) -> usize
pub fn end_element(&mut self) -> usize
pub fn start_end_element(&mut self, el: A) -> usize
Trait Implementations
Auto Trait Implementations
impl<A> RefUnwindSafe for Builder<A>where
A: RefUnwindSafe,
impl<A> Send for Builder<A>where
A: Send,
impl<A> Sync for Builder<A>where
A: Sync,
impl<A> Unpin for Builder<A>where
A: Unpin,
impl<A> UnwindSafe for Builder<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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