Enum oxidd_core::Node
source · pub enum Node<'a, M: Manager + 'a> {
Inner(&'a M::InnerNode),
Terminal(M::TerminalRef<'a>),
}Expand description
Either an inner or a terminal node
Variants§
Inner(&'a M::InnerNode)
Terminal(M::TerminalRef<'a>)
Implementations§
source§impl<'a, M: Manager> Node<'a, M>
impl<'a, M: Manager> Node<'a, M>
sourcepub fn unwrap_inner(self) -> &'a M::InnerNode
pub fn unwrap_inner(self) -> &'a M::InnerNode
Unwrap the inner node
Panics if self is a terminal.
sourcepub fn expect_inner(self, msg: &str) -> &'a M::InnerNode
pub fn expect_inner(self, msg: &str) -> &'a M::InnerNode
Unwrap the inner node
Panics with msg if self is a terminal.
sourcepub fn unwrap_terminal(&self) -> &M::Terminal
pub fn unwrap_terminal(&self) -> &M::Terminal
Unwrap the terminal
Panics if self is an inner node
sourcepub fn expect_terminal(&self, msg: &str) -> &M::Terminal
pub fn expect_terminal(&self, msg: &str) -> &M::Terminal
Unwrap the terminal
Panics with msg if self is an inner node
sourcepub fn is_any_terminal(self) -> bool
pub fn is_any_terminal(self) -> bool
Returns true if this is any terminal node
sourcepub fn is_terminal(self, terminal: &M::Terminal) -> bool
pub fn is_terminal(self, terminal: &M::Terminal) -> bool
Returns true if this is the given terminal
Trait Implementations§
impl<'a, M: Manager + 'a> Copy for Node<'a, M>
Auto Trait Implementations§
impl<'a, M> Freeze for Node<'a, M>
impl<'a, M> RefUnwindSafe for Node<'a, M>
impl<'a, M> Send for Node<'a, M>
impl<'a, M> Sync for Node<'a, M>
impl<'a, M> Unpin for Node<'a, M>
impl<'a, M> UnwindSafe for Node<'a, M>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more