[][src]Struct generic_tree::Node

pub struct Node<K, V> { /* fields omitted */ }

Implementations

impl<K, V> Node<K, V> where
    K: PartialEq
[src]

pub fn new(key: K, value: V) -> Self[src]

pub fn add_child(&mut self, child: Node<K, V>) -> Option<Box<Node<K, V>>>[src]

pub fn add_child_at_path(
    &mut self,
    path: &[&K],
    child: Node<K, V>
) -> Result<Option<Box<Node<K, V>>>, Error>
[src]

pub fn get_child<Q>(&self, path: &[Q]) -> Option<&Node<K, V>> where
    Q: PartialEq<K>, 
[src]

Get a child node based on a list of keys.

Examples

use generic_tree::Node;



// Tree structure:
// grandparent -> parent -> child
assert!(grandparent.get_child(&["parent", "child"]).is_some());

pub fn get_mut_child(&mut self, path: &[&K]) -> Option<&mut Node<K, V>>[src]

pub fn take_child(&mut self, path: &[&K]) -> Option<Node<K, V>>[src]

pub fn value(&self) -> &V[src]

pub fn mut_value(&mut self) -> &mut V[src]

pub fn key(&self) -> &K[src]

Trait Implementations

impl<K, V> PartialEq<K> for Node<K, V> where
    K: PartialEq
[src]

impl<K, V> PartialEq<Node<K, V>> for Node<K, V> where
    K: PartialEq
[src]

Auto Trait Implementations

impl<K, V> RefUnwindSafe for Node<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

impl<K, V> Send for Node<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for Node<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for Node<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for Node<K, V> where
    K: UnwindSafe,
    V: 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<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.