[][src]Struct read_tree::Vertex

pub struct Vertex<T> { /* fields omitted */ }

An internal type that stores the payload and relationships of a node in a Tree<T> or PolyTree<T>.

Every node on the tree is represented by a Vertex<T>. The len field stores the number of descendants the node has; this is the number of nodes in the subtree below the node. A leaf node has length 0.

Every Tree<T> contains a Vec<Vertex<T>> representing the trees nodes in a depth first order; meaning every vertex is followed by its first child. This makes it very easy to take a slice of the vertex buffer that represents a subtree. We expose such a slice to the user as a Node<T>.

The type implements Clone and Copy as long as the payload T implements the same. Supporting Copy is important to ensure Vec::extend_from_slice executes as fast as possible. This method is used by Sapling::push_tree to copy the nodes of a tree into another sapling.

Methods

impl<T> Vertex<T>[src]

pub fn new(data: T, len: usize) -> Self[src]

Returns a new vertex with payload data intending to own len many descendants.

Trait Implementations

impl<T: Clone> Clone for Vertex<T>[src]

impl<T: Copy> Copy for Vertex<T>[src]

impl<T: Debug> Debug for Vertex<T>[src]

Auto Trait Implementations

impl<T> Send for Vertex<T> where
    T: Send

impl<T> Sync for Vertex<T> where
    T: Sync

impl<T> Unpin for Vertex<T> where
    T: Unpin

impl<T> UnwindSafe for Vertex<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Vertex<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]