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 aquire(&self) -> Option<ExclusiveId>
pub fn aquire(&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 aquired.
Trait Implementations§
Source§impl AsRef<Id> for ExclusiveId
impl AsRef<Id> for ExclusiveId
Source§impl Borrow<Id> for ExclusiveId
impl Borrow<Id> for ExclusiveId
Source§impl Ord for Id
impl Ord for Id
Source§impl PartialOrd for Id
impl PartialOrd 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 TryFromValue<'_, GenId> for Id
impl TryFromValue<'_, GenId> for Id
Source§impl<'a> TryFromValue<'a, GenId> for &'a Id
impl<'a> TryFromValue<'a, GenId> for &'a Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for 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§
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§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<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)