[][src]Struct rtable::tree::Node

pub struct Node<P: Prefixable, D> { /* fields omitted */ }

Node struct.

Methods

impl<P: Prefixable, D> Node<P, D>[src]

Node impl.

pub fn new(prefix: &P) -> Node<P, D>[src]

Return new node.

pub fn from_common(prefix1: &P, prefix2: &P) -> Node<P, D>[src]

Return new node with common prefix.

pub fn prefix(&self) -> &P[src]

Return reference to prefix.

pub fn child(&self, bit: Child) -> Option<Rc<Node<P, D>>>[src]

Return one of child node - left(0) or right(1)

pub fn child_with(&self, bit: u8) -> Option<Rc<Node<P, D>>>[src]

Return one of child node - left(0) or right(1)

pub fn has_child_with(&self, bit: u8) -> bool[src]

Return true if child at left or right.

pub fn parent(&self) -> Option<Rc<Node<P, D>>>[src]

Return parent node.

pub fn set_parent(&self, parent: Rc<Node<P, D>>)[src]

Set parent.

pub fn unset_parent(&self)[src]

Unset parent.

pub fn set_data(&self, data: D) -> Option<D>[src]

Set data.

pub fn unset_data(&self) -> Option<D>[src]

Unset data.

pub fn data(&self) -> RefMut<Option<D>>[src]

Return reference to data.

pub fn has_data(&self) -> bool[src]

Return true if node has data.

pub fn is_locked(&self) -> bool[src]

Return true if node has child or data.

pub fn next(&self) -> Option<Rc<Node<P, D>>>[src]

Return next Node. TODO: refactoring

pub fn next_with_data(&self) -> Option<Rc<Node<P, D>>>[src]

Return next Node with data.

Auto Trait Implementations

impl<P, D> !RefUnwindSafe for Node<P, D>

impl<P, D> !Send for Node<P, D>

impl<P, D> !Sync for Node<P, D>

impl<P, D> Unpin for Node<P, D> where
    D: Unpin,
    P: Unpin

impl<P, D> !UnwindSafe for Node<P, D>

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.