pub struct NodeId(/* private fields */);Expand description
A node’s place in the plan, as the first column spells it: 2,
2.3, 2.3.1. The parent is the prefix, so the tree needs no second
field to say where a node hangs.
Ordering is the reading order of the table — 1, 1.1, 1.2, 2 —
because segment-wise comparison is exactly that order.
Implementations§
Source§impl NodeId
impl NodeId
Sourcepub fn parse(raw: &str) -> Result<NodeId, AxError>
pub fn parse(raw: &str) -> Result<NodeId, AxError>
Reads an index cell.
§Errors
Refuses an empty cell, a segment that is not a number, a zero
segment (the table is one-based, and 0 next to 1 reads as a
different node than it is), a leading zero (01 and 1 would be
two spellings of one node), and a branch deeper than
NODE_DEPTH_MAX.
Sourcepub fn parent(&self) -> Option<NodeId>
pub fn parent(&self) -> Option<NodeId>
The node this one hangs under, or None for a top-level node.
Sourcepub fn is_ancestor_of(&self, other: &NodeId) -> bool
pub fn is_ancestor_of(&self, other: &NodeId) -> bool
Whether other hangs below this node, at any depth. A node is
not its own ancestor.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeId
impl<'de> Deserialize<'de> for NodeId
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NodeId
Source§impl Ord for NodeId
impl Ord for NodeId
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for NodeId
impl PartialOrd for NodeId
impl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl Freeze for NodeId
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin for NodeId
impl UnsafeUnpin for NodeId
impl UnwindSafe for NodeId
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