Struct lolid::Uuid [−][src]
#[repr(transparent)]pub struct Uuid { /* fields omitted */ }
Expand description
Universally unique identifier, consisting of 128-bits, as according to RFC4122
Implementations
Creates new Uuid from raw bytes.
Creates new Uuid from byte slice, if its size is 16, otherwise None
Creates UUID
from GUID
converting integer fields to big endian while d4
is copied as
it is.
Note that it is assumed that GUID
was correctly created in little endian format (e.g.
using winapi CoCreateGuid
which internally uses UuidCreate
which in turn relies on
secure random)
Effectively winapi GUID
would result in creation of UUID
of Random
variant.
Access underlying bytes as slice.
Returns time_low
part of uuid.
Refer to https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
Returns time_mid
part of uuid.
Refer to https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
Returns time_high_and_version
part of uuid.
Refer to https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
Returns clock_sequence
part of uuid.
Refer to https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
Returns node
part of uuid.
Refer to https://en.wikipedia.org/wiki/Universally_unique_identifier#Format
Checks if UUID
version is equal to the provided version
Checks if UUID
variant is set, only cares about RFC4122 byte
Generates UUID from time and mac address
Generates UUID v3
by using md5
hasher
Only available when md5
feature is enabled.
Constructs UUID v4
from provided bytes, assuming they are random.
It is up to user to guarantee that it is random.
This function only sets corresponding bits for v4
Generates UUID v4
using OS RNG from getrandom
Only available when osrng
feature is enabled.
Generates UUID v4
using PRNG from wyhash
Only available when prng
feature is enabled.
This random variant generates predictable UUID, even though they are unique. Which means that each time program starts, it is initialized with the same seed and therefore would repeat UUIDs
This random is useful when you want to generate predictable but unique UUIDs
Otherwise use v4
Generates UUID v5
by using sha1
hasher
Only available when sha1
feature is enabled.
Adds variant byte to the corresponding field.
This implementation only cares about RFC4122, there is no option to set other variant.
Useful when user is supplied with random bytes, and wants to create UUID from it.
Adds version byte to the corresponding field.
Useful when user is supplied with random bytes, and wants to create UUID from it.
Creates new instance by parsing provided bytes.
Use this when you want to avoid performing utf-8 checks and directly feed bytes. As long as supplied bytes contain valid ascii characters it will parse successfully. Otherwise it shall fail with invalid character.
Supports only simple sequence of characters and -
separated.
Creates new instance by parsing provided string.
Supports only simple sequence of characters and -
separated.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Uuid
impl UnwindSafe for Uuid
Blanket Implementations
Mutably borrows from an owned value. Read more