pub struct Id { /* private fields */ }Expand description
Represents a unique abstract 128 bit identifier.
As we do not allow for all zero nil IDs,
Option<Id> benefits from Option nieche optimizations.
Note that it has an alignment of 1, and can be referenced as a [u8; 16] RawId.
Implementations§
Source§impl Id
impl Id
Sourcepub fn from_hex(hex: &str) -> Option<Self>
pub fn from_hex(hex: &str) -> Option<Self>
Parses a hexadecimal identifier string into an Id.
Returns None if the input is not valid hexadecimal or represents the
nil identifier (all zero bytes).
Sourcepub fn as_transmute_raw(id: &RawId) -> Option<&Self>
pub fn as_transmute_raw(id: &RawId) -> Option<&Self>
Sourcepub fn acquire(&self) -> Option<ExclusiveId>
pub fn acquire(&self) -> Option<ExclusiveId>
Takes ownership of this Id from the current write context (i.e. thread).
Returns None if this Id was not found, because it is not associated with this
write context, or because it is currently acquired.
Trait Implementations§
Source§impl AsRef<Id> for ExclusiveId
impl AsRef<Id> for ExclusiveId
Source§impl Borrow<Id> for ExclusiveId
impl Borrow<Id> for ExclusiveId
impl Copy for Id
Source§impl Encodes<&Id> for GenId
impl Encodes<&Id> for GenId
Source§impl Encodes<Id> for GenId
impl Encodes<Id> for GenId
impl Eq for Id
Source§impl Ord for Id
impl Ord for Id
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 Id
impl PartialOrd for Id
impl StructuralPartialEq for Id
Source§impl TryFrom<Uuid> for Id
impl TryFrom<Uuid> for Id
Source§type Error = NilUuidError
type Error = NilUuidError
The type returned in the event of a conversion error.
Source§impl TryFromInline<'_, GenId> for Id
impl TryFromInline<'_, GenId> for Id
Source§impl<'a> TryFromInline<'a, GenId> for &'a Id
impl<'a> TryFromInline<'a, GenId> for &'a Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnsafeUnpin for Id
impl UnwindSafe for Id
Blanket Implementations§
impl<T> ArchiveOwner for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
impl<S, T> IntoEncoded<S> for Twhere
S: Encodes<T>,
Source§fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
fn into_encoded(self) -> <T as IntoEncoded<S>>::Output
Run the conversion.
Source§impl<S, T> IntoInline<S> for T
impl<S, T> IntoInline<S> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)