Struct ego_tree::Tree
[−]
[src]
pub struct Tree<T> { /* fields omitted */ }
Vec-backed ID-tree.
Always contains at least a root node.
Methods
impl<T> Tree<T>
[src]
ⓘImportant traits for Values<'a, T>pub fn values(&self) -> Values<T>
[src]
Returns an iterator over values in insert order.
ⓘImportant traits for ValuesMut<'a, T>pub fn values_mut(&mut self) -> ValuesMut<T>
[src]
Returns a mutable iterator over values in insert order.
ⓘImportant traits for Nodes<'a, T>pub fn nodes(&self) -> Nodes<T>
[src]
Returns an iterator over nodes in insert order.
impl<T> Tree<T>
[src]
pub fn new(root: T) -> Self
[src]
Creates a tree with a root node.
pub fn with_capacity(root: T, capacity: usize) -> Self
[src]
Creates a tree with a root node and the specified capacity.
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.
pub unsafe fn get(&self, id: NodeId<T>) -> NodeRef<T>
[src]
Returns a reference to the specified node.
pub unsafe fn get_mut(&mut self, id: NodeId<T>) -> NodeMut<T>
[src]
Returns a mutator of the specified node.
Trait Implementations
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?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more
impl<T: Clone> Clone for Tree<T>
[src]
fn clone(&self) -> Tree<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for Tree<T>
[src]
fn eq(&self, __arg_0: &Tree<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Tree<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for Tree<T>
[src]
impl<T: Hash> Hash for Tree<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more