pub struct GraphNodeId(/* private fields */);Expand description
A unique identifier for nodes in a graph structure.
GraphNodeId is a newtype wrapper around a u64 that provides a unique identifier
for each node in a graph. The ID is automatically generated using an atomic counter,
ensuring thread-safe unique ID generation across the application.
§Examples
use radiate_gp::collections::GraphNodeId;
let id1 = GraphNodeId::new();
let id2 = GraphNodeId::new();
assert_ne!(id1, id2); // Each ID is unique§Implementation Details
- Uses an atomic counter (
AtomicU64) to ensure thread-safe ID generation - Implements
Debug,Clone,Copy,PartialEq,Eq,Hash,PartialOrd, andOrd - When the “serde” feature is enabled, implements
SerializeandDeserialize - Uses
#[repr(transparent)]to ensure the same memory layout asu64
Implementations§
Source§impl GraphNodeId
impl GraphNodeId
Trait Implementations§
Source§impl Clone for GraphNodeId
impl Clone for GraphNodeId
Source§fn clone(&self) -> GraphNodeId
fn clone(&self) -> GraphNodeId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphNodeId
impl Debug for GraphNodeId
Source§impl Hash for GraphNodeId
impl Hash for GraphNodeId
Source§impl Ord for GraphNodeId
impl Ord for GraphNodeId
Source§fn cmp(&self, other: &GraphNodeId) -> Ordering
fn cmp(&self, other: &GraphNodeId) -> Ordering
1.21.0 · 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 PartialEq for GraphNodeId
impl PartialEq for GraphNodeId
Source§impl PartialOrd for GraphNodeId
impl PartialOrd for GraphNodeId
impl Copy for GraphNodeId
impl Eq for GraphNodeId
impl StructuralPartialEq for GraphNodeId
Auto Trait Implementations§
impl Freeze for GraphNodeId
impl RefUnwindSafe for GraphNodeId
impl Send for GraphNodeId
impl Sync for GraphNodeId
impl Unpin for GraphNodeId
impl UnsafeUnpin for GraphNodeId
impl UnwindSafe for GraphNodeId
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.