pub struct Uuid(/* private fields */);
Expand description
A structure representing a UUID (Universally Unique Identifier).
Implementations§
source§impl Uuid
impl Uuid
sourcepub fn from_parts(value: [u32; 4]) -> Self
pub fn from_parts(value: [u32; 4]) -> Self
Creates a new UUID from 4 parts represented as an array of u32
.
sourcepub fn from_u128(value: u128) -> Self
pub fn from_u128(value: u128) -> Self
Converts a u128
value into a UUID by splitting it into four u32
parts.
sourcepub fn as_hyphened(&self, f: &mut impl Write) -> Result
pub fn as_hyphened(&self, f: &mut impl Write) -> Result
Formats the UUID as a hyphenated string (e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
).
sourcepub fn as_parentheses(&self, f: &mut impl Write) -> Result
pub fn as_parentheses(&self, f: &mut impl Write) -> Result
Formats the UUID within parentheses string (e.g., {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
).
sourcepub fn as_simple(&self, f: &mut impl Write) -> Result
pub fn as_simple(&self, f: &mut impl Write) -> Result
Formats the UUID as a simple string without hyphens (e.g., xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
).
pub fn to_simple_string(&self) -> String
pub fn to_hyphened_string(&self) -> String
Trait Implementations§
source§impl Deserialize for Uuid
impl Deserialize for Uuid
fn deserialize<D: Deserializer>(deserializer: D) -> Result<Self, Error>
source§impl Ord for Uuid
impl Ord for Uuid
source§impl PartialOrd for Uuid
impl PartialOrd for Uuid
impl Copy for Uuid
impl Eq for Uuid
impl StructuralPartialEq for Uuid
Auto Trait Implementations§
impl Freeze for Uuid
impl RefUnwindSafe for Uuid
impl Send for Uuid
impl Sync for Uuid
impl Unpin for Uuid
impl UnwindSafe for Uuid
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)