pub struct Node<T> {
pub data: T,
/* private fields */
}Expand description
A node within a particular Arena
Fields§
§data: TThe actual data which will be stored within the tree
Implementations§
Source§impl<T> Node<T>
impl<T> Node<T>
Sourcepub fn parent(&self) -> Option<NodeId>
pub fn parent(&self) -> Option<NodeId>
Return the ID of the parent node, unless this node is the root of the tree.
Sourcepub fn first_child(&self) -> Option<NodeId>
pub fn first_child(&self) -> Option<NodeId>
Return the ID of the first child of this node, unless it has no child.
Sourcepub fn last_child(&self) -> Option<NodeId>
pub fn last_child(&self) -> Option<NodeId>
Return the ID of the last child of this node, unless it has no child.
Sourcepub fn previous_sibling(&self) -> Option<NodeId>
pub fn previous_sibling(&self) -> Option<NodeId>
Return the ID of the previous sibling of this node, unless it is a first child.
Sourcepub fn next_sibling(&self) -> Option<NodeId>
pub fn next_sibling(&self) -> Option<NodeId>
Return the ID of the previous sibling of this node, unless it is a first child.
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