[−][src]Struct indextree::Arena
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]
fn clone(&self) -> Arena<T>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for Arena<T>
[src]
impl<T> Index<NodeId> for Arena<T>
[src]
type Output = Node<T>
The returned type after indexing.
fn index(&self, node: NodeId) -> &Node<T>
[src]
impl<T> IndexMut<NodeId> for Arena<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,