[−][src]Struct ego_tree::Tree
Vec-backed ID-tree.
Always contains at least a root node.
Methods
impl<T> Tree<T>
[src]
impl<T> Tree<T>
ⓘ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]
impl<T> Tree<T>
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 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.
Trait Implementations
impl<T> PartialEq<Tree<T>> for Tree<T> where
T: PartialEq,
[src]
impl<T> PartialEq<Tree<T>> for Tree<T> where
T: PartialEq,
fn eq(&self, other: &Self) -> bool | [src] |
| 1.0.0 [src] |
This method tests for !=
.
impl<T> Eq for Tree<T> where
T: Eq,
[src]
impl<T> Eq for Tree<T> where
T: Eq,
impl<T> Clone for Tree<T> where
T: Clone,
[src]
impl<T> Clone for Tree<T> where
T: Clone,
fn clone(&self) -> Self | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl<T> IntoIterator for Tree<T>
[src]
impl<T> IntoIterator for Tree<T>
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] |
impl<T: Debug> Debug for Tree<T>
[src]
impl<T: Debug> Debug for Tree<T>
impl<T> Hash for Tree<T> where
T: Hash,
[src]
impl<T> Hash for Tree<T> where
T: Hash,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<I> IntoIterator for I where
I: Iterator,
[src]
impl<I> IntoIterator for I where
I: Iterator,
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?
fn into_iter(self) -> I | [src] |
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)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]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |