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 indicies 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 = 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
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
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more