Struct VecTree

Source
pub struct VecTree<A> {
    pub nav: Navigator,
    pub values: Vec<A>,
}

Fields§

§nav: Navigator§values: Vec<A>

Trait Implementations§

Source§

impl<'a, A> Tree<'a> for VecTree<A>
where A: 'a,

Source§

type Node = &'a A

The type of the trees nodes
Source§

type SubtreeType = SubtreeImpl<&'a VecTree<A>>

The type of the subtree, returned by root()
Source§

fn at_pos(&'a self, index: usize) -> Self::SubtreeType

Direct access to a node in the tree via its position in the flat map
Source§

fn get_nav(&self) -> &Navigator

Direct access to the Navigator storing the neighboring information of the tree
Source§

fn root(&'a self) -> Self::SubtreeType

The root node of the tree.
Source§

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>
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
Source§

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>
where B: 'a + Clone, F: Fn(Self::Node) -> B,

Use flange, but create the data using the mapf function
Source§

fn for_each<F>(&'a self, f: F)
where F: FnMut(Self::SubtreeType),

Source§

fn depth_first_flange<B, F>(&'a self, mapf: F) -> FlangedTree<&'a Self, B>
where B: 'a + Default + Clone, F: Fn(Self::Node, Vec<&B>) -> B,

Flange data to the nodes using a map function in a depth first order. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.