[][src]Struct indextree::Arena

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

An Arena structure containing certain Nodes

Methods

impl<T> Arena<T>[src]

pub fn new() -> Arena<T>[src]

Create a new empty Arena

pub fn new_node(&mut self, data: T) -> NodeId[src]

Create a new node from its associated data.

Panics

Panics if the arena already has usize::max_value() nodes.

pub fn count(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

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

Get a reference to the node with the given id if in the arena, None otherwise.

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

Get a mutable reference to the node with the given id if in the arena, None otherwise.

pub fn iter(&self) -> Iter<Node<T>>[src]

Iterate over all nodes in the arena in storage-order.

Note that this iterator also contains removed elements, which can be tested with the is_removed() method on the node.

Trait Implementations

impl<T: PartialEq> PartialEq<Arena<T>> for Arena<T>[src]

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

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Index<NodeId> for Arena<T>[src]

type Output = Node<T>

The returned type after indexing.

impl<T> IndexMut<NodeId> for Arena<T>[src]

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T[src]

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

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

type Owned = T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]