pub struct Node<T>where
T: Debug,{
pub data: T,
/* private fields */
}
Expand description
A node in the hierarchy
Fields§
§data: T
Data associated with the node
Implementations§
Source§impl<T> Node<T>where
T: Debug,
impl<T> Node<T>where
T: Debug,
Sourcepub fn has_parent(&self) -> bool
pub fn has_parent(&self) -> bool
Returns true if the node has a parent - i.e. it is not the root of the hierarchy
Sourcepub fn set_parent(&mut self, parent: Option<usize>)
pub fn set_parent(&mut self, parent: Option<usize>)
Set the parent of a node
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Return true if the node has children
Trait Implementations§
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