pub struct NodeId(/* private fields */);Expand description
A unique identifier for a node.
In view callbacks, create NodeIds with the crate::id macro.
Implementations§
Source§impl NodeId
impl NodeId
Sourcepub fn next() -> Self
pub fn next() -> Self
Create a new NodeId. For times when the id!() macro isn’t appropriate, such as when creating ids in a loop.
Not suitable for use in a view callback since it returns a unique id every time.
Sourcepub fn set_counter(value: u64)
pub fn set_counter(value: u64)
Resume NodeId generation from a specific value.
This is useful in the exceptionally rare cases when resuming id creation
from a particular value with the NodeId::next() function is required.
Panics: if value is zero, as NodeId values must be non-zero.
Sourcepub fn get_counter() -> u64
pub fn get_counter() -> u64
Returns the current value of the NodeId generator.
Useful for persisting the id counter to resume later with NodeId::set_counter().
Trait Implementations§
impl Copy for NodeId
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
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
impl<T> Brush for T
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.