pub struct Node {
pub parent: Option<NodeId>,
pub previous_sibling: Option<NodeId>,
pub next_sibling: Option<NodeId>,
pub last_child: Option<NodeId>,
}Expand description
Hierarchical information about a node (stores the indices of the parent / child nodes).
Fields§
§parent: Option<NodeId>§previous_sibling: Option<NodeId>§next_sibling: Option<NodeId>§last_child: Option<NodeId>Implementations§
Source§impl Node
impl Node
pub const ROOT: Node
pub const fn has_parent(&self) -> bool
pub const fn has_previous_sibling(&self) -> bool
pub const fn has_next_sibling(&self) -> bool
pub const fn has_first_child(&self) -> bool
pub const fn has_last_child(&self) -> bool
pub fn get_first_child(&self, current_node_id: NodeId) -> Option<NodeId>
Trait Implementations§
Source§impl From<Node> for NodeHierarchyItem
impl From<Node> for NodeHierarchyItem
Source§fn from(node: Node) -> NodeHierarchyItem
fn from(node: Node) -> NodeHierarchyItem
Converts to this type from the input type.
Source§impl Ord for Node
impl Ord for Node
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Node
impl PartialOrd for Node
impl Copy for Node
impl Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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