Struct flange_flat_tree::FlangedTree
source · [−]pub struct FlangedTree<TD, A>where
TD: TreeData,{ /* private fields */ }
Implementations
sourceimpl<TD, A> FlangedTree<TD, A>where
TD: TreeData,
impl<TD, A> FlangedTree<TD, A>where
TD: TreeData,
pub fn new(base: TD, data: Vec<A>) -> Self
pub fn replace_map_flange<'a, B, F>(&'a self, mapf: F) -> FlangedTree<TD, B>where
F: Fn(<FlangedTree<TD, A> as Tree<'a>>::Node) -> B,
pub fn get_flange(&self, index: usize) -> &A
pub fn get_flange_mut(&mut self, index: usize) -> &mut A
Trait Implementations
sourceimpl<'a, TD, A> Tree<'a> for FlangedTree<TD, A>where
A: 'a,
TD: TreeData + 'a,
impl<'a, TD, A> Tree<'a> for FlangedTree<TD, A>where
A: 'a,
TD: TreeData + 'a,
type SubtreeType = SubtreeImpl<&'a FlangedTree<TD, A>>
type SubtreeType = SubtreeImpl<&'a FlangedTree<TD, A>>
The type of the subtree, returned by
root()
sourcefn 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 treesourcefn root(&'a self) -> Self::SubtreeType
fn root(&'a self) -> Self::SubtreeType
The root node of the tree.
sourcefn node_count(&'a self) -> usize
fn node_count(&'a self) -> usize
The number of nodes in the tree.
sourcefn map<B, M>(&'a self, m: M) -> MappedTree<Self::Node, B, M, &'a Self>where
M: Fn(usize, Self::Node) -> B,
fn map<B, M>(&'a self, m: M) -> MappedTree<Self::Node, B, M, &'a Self>where
M: Fn(usize, Self::Node) -> B,
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
sourcefn 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. Read moresourcefn flange_map<B, F>(&'a self, mapf: F) -> FlangedTree<&'a Self, B>where
B: 'a,
B: Clone,
F: Fn(Self::Node) -> B,
fn flange_map<B, F>(&'a self, mapf: F) -> FlangedTree<&'a Self, B>where
B: 'a,
B: Clone,
F: Fn(Self::Node) -> 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<TD, A> RefUnwindSafe for FlangedTree<TD, A>where
A: RefUnwindSafe,
TD: RefUnwindSafe,
impl<TD, A> Send for FlangedTree<TD, A>where
A: Send,
TD: Send,
impl<TD, A> Sync for FlangedTree<TD, A>where
A: Sync,
TD: Sync,
impl<TD, A> Unpin for FlangedTree<TD, A>where
A: Unpin,
TD: Unpin,
impl<TD, A> UnwindSafe for FlangedTree<TD, A>where
A: UnwindSafe,
TD: 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