[−][src]Struct generic_tree::Node
Implementations
impl<K, V> Node<K, V> where
K: PartialEq, [src]
K: PartialEq,
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]
&mut self,
path: &[&K],
child: Node<K, V>
) -> Result<Option<Box<Node<K, V>>>, Error>
pub fn get_child<Q>(&self, path: &[Q]) -> Option<&Node<K, V>> where
Q: PartialEq<K>, [src]
Q: PartialEq<K>,
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]
K: PartialEq,
impl<K, V> PartialEq<Node<K, V>> for Node<K, V> where
K: PartialEq, [src]
K: PartialEq,
Auto Trait Implementations
impl<K, V> RefUnwindSafe for Node<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Node<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for Node<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for Node<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for Node<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,