Struct cl_structures::tree::Node
source · pub struct Node<T> { /* private fields */ }
Expand description
A node in a Tree
Implementations§
source§impl<T> Node<T>
impl<T> Node<T>
pub const fn new(value: T) -> Self
pub const fn with_parent(value: T, parent: Ref<T>) -> Self
pub fn get(&self) -> &T
pub fn get_mut(&mut self) -> &mut T
pub fn swap(&mut self, value: T) -> T
pub fn parent(&self) -> Option<Ref<T>>
pub fn children(&self) -> &[Ref<T>]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
source§impl<T: Ord> Ord for Node<T>
impl<T: Ord> Ord for Node<T>
source§impl<T: PartialEq> PartialEq for Node<T>
impl<T: PartialEq> PartialEq for Node<T>
source§impl<T: PartialOrd> PartialOrd for Node<T>
impl<T: PartialOrd> PartialOrd for Node<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<T: Eq> Eq for Node<T>
impl<T> StructuralPartialEq for Node<T>
Auto Trait Implementations§
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnwindSafe for Node<T>where
T: UnwindSafe,
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