Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/node/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ pub trait Node: Send + Sync {
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy, Ord, PartialOrd)]
pub struct NodeId(pub(crate) usize);

impl NodeId {
/// Return the numeric identifier wrapped by this `NodeId`.
pub fn as_usize(&self) -> usize {
self.0
}
}

impl From<NodeId> for usize {
fn from(value: NodeId) -> Self {
value.0
}
}

pub type NodeName = String;

/// [NodeTable]: a mapping from [Node]'s name to [NodeId].
Expand Down
Loading