pub struct VecTree<A> {
pub nav: Navigator,
pub values: Vec<A>,
}
Fields§
§values: Vec<A>
Trait Implementations§
Source§impl<'a, A> Tree<'a> for VecTree<A>where
A: 'a,
impl<'a, A> Tree<'a> for VecTree<A>where
A: 'a,
Source§type SubtreeType = SubtreeImpl<&'a VecTree<A>>
type SubtreeType = SubtreeImpl<&'a VecTree<A>>
The type of the subtree, returned by
root()
Source§fn at_pos(&'a self, index: usize) -> Self::SubtreeType
fn at_pos(&'a self, index: usize) -> Self::SubtreeType
Direct access to a node in the tree via its position in the flat map
Direct access to the
Navigator
storing the neighboring information of the treeSource§fn root(&'a self) -> Self::SubtreeType
fn root(&'a self) -> Self::SubtreeType
The root node of the tree.
Source§fn node_count(&'a self) -> usize
fn node_count(&'a self) -> usize
The number of nodes in the tree.
Source§fn map<B, M>(&'a self, m: M) -> MappedTree<Self::Node, B, M, &'a Self>
fn map<B, M>(&'a self, m: M) -> MappedTree<Self::Node, B, M, &'a Self>
Create a new tree using a function to map from the nodes of this tree.
The map function can also include external data sources. Read more
Source§fn flange<B>(&'a self, data: Vec<B>) -> FlangedTree<&'a Self, B>
fn flange<B>(&'a self, data: Vec<B>) -> FlangedTree<&'a Self, B>
Flange data to the nodes.
A new tree is created, that references the old tree and whos
Node
type is a typle with a reference to the old data
and a reference to the new data from the inserted data
vector.Source§fn flange_map<B, F>(&'a self, mapf: F) -> FlangedTree<&'a Self, B>
fn flange_map<B, F>(&'a self, mapf: F) -> FlangedTree<&'a Self, B>
Use
flange
, but create the data using the mapf
functionfn for_each<F>(&'a self, f: F)where
F: FnMut(Self::SubtreeType),
Auto Trait Implementations§
impl<A> Freeze for VecTree<A>
impl<A> RefUnwindSafe for VecTree<A>where
A: RefUnwindSafe,
impl<A> Send for VecTree<A>where
A: Send,
impl<A> Sync for VecTree<A>where
A: Sync,
impl<A> Unpin for VecTree<A>where
A: Unpin,
impl<A> UnwindSafe for VecTree<A>where
A: UnwindSafe,
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