[][src]Struct oxymcts::Tree

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

Vec-backed ID-tree.

Always contains at least a root node.

Implementations

impl<T> Tree<T>[src]

pub fn new(root: T) -> Tree<T>[src]

Creates a tree with a root node.

pub fn with_capacity(root: T, capacity: usize) -> Tree<T>[src]

Creates a tree with a root node and the specified capacity.

pub fn get(&self, id: NodeId) -> Option<NodeRef<'_, T>>[src]

Returns a reference to the specified node.

pub fn get_mut(&mut self, id: NodeId) -> Option<NodeMut<'_, T>>[src]

Returns a mutator of the specified node.

pub unsafe fn get_unchecked(&self, id: NodeId) -> NodeRef<'_, T>[src]

Returns a reference to the specified node.

pub unsafe fn get_unchecked_mut(&mut self, id: NodeId) -> NodeMut<'_, T>[src]

Returns a mutator of the specified node.

pub fn root(&self) -> NodeRef<'_, T>[src]

Returns a reference to the root node.

pub fn root_mut(&mut self) -> NodeMut<'_, T>[src]

Returns a mutator of the root node.

pub fn orphan(&mut self, value: T) -> NodeMut<'_, T>[src]

Creates an orphan node.

impl<T> Tree<T>[src]

pub fn values(&self) -> Values<'_, T>

Notable traits for Values<'a, T>

impl<'a, T> Iterator for Values<'a, T> where
    T: 'a, 
type Item = &'a T;
[src]

Returns an iterator over values in insert order.

pub fn values_mut(&mut self) -> ValuesMut<'_, T>

Notable traits for ValuesMut<'a, T>

impl<'a, T> Iterator for ValuesMut<'a, T> where
    T: 'a, 
type Item = &'a mut T;
[src]

Returns a mutable iterator over values in insert order.

pub fn nodes(&self) -> Nodes<'_, T>

Notable traits for Nodes<'a, T>

impl<'a, T> Iterator for Nodes<'a, T> where
    T: 'a, 
type Item = NodeRef<'a, T>;
[src]

Returns an iterator over nodes in insert order.

Trait Implementations

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

impl<T> Debug for Tree<T> where
    T: Debug
[src]

impl<T> Eq for Tree<T> where
    T: Eq
[src]

impl<T> Hash for Tree<T> where
    T: Hash
[src]

impl<T> IntoIterator for Tree<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T> PartialEq<Tree<T>> for Tree<T> where
    T: PartialEq<T>, 
[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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<V, T> VZip<V> for T where
    V: MultiLane<T>,