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: PartialOrd> PartialOrd for Node<T>
impl<T: PartialOrd> PartialOrd for Node<T>
impl<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