Struct contigious_tree::TreeBuilder
source · [−]pub struct TreeBuilder<N, W> { /* private fields */ }
Expand description
Serializes a tree data structure in a depth first manner.
Implementations
sourceimpl<N, W> TreeBuilder<N, W>
impl<N, W> TreeBuilder<N, W>
pub fn new(writer: W) -> Self
sourcepub fn write_node(
&mut self,
value: &N::Value,
num_children: usize
) -> Result<()> where
N: Node,
W: Write,
pub fn write_node(
&mut self,
value: &N::Value,
num_children: usize
) -> Result<()> where
N: Node,
W: Write,
Adds a node to the tree.
Parameters
value
: Value associated with the nodenum_children
: This node will be the parent node of the lastnum_children
nodes written which do not have a parent yet.
Auto Trait Implementations
impl<N, W> RefUnwindSafe for TreeBuilder<N, W> where
N: RefUnwindSafe,
W: RefUnwindSafe,
impl<N, W> Send for TreeBuilder<N, W> where
N: Send,
W: Send,
impl<N, W> Sync for TreeBuilder<N, W> where
N: Sync,
W: Sync,
impl<N, W> Unpin for TreeBuilder<N, W> where
N: Unpin,
W: Unpin,
impl<N, W> UnwindSafe for TreeBuilder<N, W> where
N: UnwindSafe,
W: UnwindSafe,
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