pub struct Uuid { /* private fields */ }Expand description
Universally unique identifier.
UUIDs consist of an origin and an optional timestamp, both 64 bit integers.
Implementations
sourceimpl Uuid
impl Uuid
sourcepub fn set_node_id(s: &str) -> Result<()>
pub fn set_node_id(s: &str) -> Result<()>
Sets the default UUID origin. s must not be longer than 10 characters and only consist of
[0-9a-zA-Z~_].
sourcepub fn known(s: &[u8]) -> Result<Self>
pub fn known(s: &[u8]) -> Result<Self>
New “transcendent” UUID with origin s and no timestamp. Used to identify “global”
entities like types. s must a array of [0-9a-zA-Z~_] no longer than 10 characters.
sourcepub fn now() -> Self
pub fn now() -> Self
New UUID with the default origin (see node_id and set_node_id) and the current time.
Ignoring leap seconds and other events that mess with the system time all calls to this
functions return unique UUID (duh).
sourcepub fn now_foreign(s: &[u8]) -> Result<Self>
pub fn now_foreign(s: &[u8]) -> Result<Self>
New timestamped UUID with origin s. See now. s must a array of
[0-9a-zA-Z~_] no longer than 10 characters.
sourcepub fn from_bytes(b: &[u8]) -> Result<Uuid>
pub fn from_bytes(b: &[u8]) -> Result<Uuid>
Parses a 16 byte UUID from b. Must be a 16 byte slice.
Trait Implementations
sourceimpl Ord for Uuid
impl Ord for Uuid
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Uuid> for Uuid
impl PartialOrd<Uuid> for Uuid
sourcefn partial_cmp(&self, other: &Uuid) -> Option<Ordering>
fn partial_cmp(&self, other: &Uuid) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Uuid
impl StructuralEq for Uuid
impl StructuralPartialEq for Uuid
Auto Trait Implementations
impl RefUnwindSafe for Uuid
impl Send for Uuid
impl Sync for Uuid
impl Unpin for Uuid
impl UnwindSafe for Uuid
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.