Struct im_pathtree::NodeId
source · pub struct NodeId(/* private fields */);
Expand description
Fast, ephemeral node identifier.
Unique across all in-memory nodes within a single process. Identifiers are re-generated and assigned when the process is restarted and must not be stored permanently!
Implementations§
source§impl NodeId
impl NodeId
sourcepub fn new() -> Self
pub fn new() -> Self
Generate a new, unique identifier.
Only the first usize::MAX
identifiers are guaranteed to be unique.
All following identifiers will be duplicates of previous ones.
The node IDs are unique within a single process, even across multiple trees. Different nodes always have different IDs, no matter if they are in the same tree or not.
let foo_id = NodeId::new();
let bar_id = NodeId::new();
assert_ne!(foo_id, bar_id);
Trait Implementations§
source§impl PartialEq for NodeId
impl PartialEq for NodeId
impl Copy for NodeId
impl Eq for NodeId
impl StructuralEq for NodeId
impl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin 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