pub struct Guid(/* private fields */);Expand description
A GUID is a unique identifier. Stored internally in the Microsoft Guid format to support zero-copy deserialization
Implementations§
Source§impl Guid
impl Guid
Sourcepub const fn from_ms_bytes(raw: &[u8; 16]) -> Self
pub const fn from_ms_bytes(raw: &[u8; 16]) -> Self
Convert from a byte array ordered by https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray?view=net-5.0#System_Guid_ToByteArray Will just read first 16 bytes
Sourcepub const fn to_ms_bytes(self) -> [u8; 16]
pub const fn to_ms_bytes(self) -> [u8; 16]
Mimic format produced by https://docs.microsoft.com/en-us/dotnet/api/system.guid.tobytearray?view=net-5.0#System_Guid_ToByteArray
pub const fn from_le_bytes(b: [u8; 16]) -> Self
Sourcepub const fn to_le_bytes(self) -> [u8; 16]
pub const fn to_le_bytes(self) -> [u8; 16]
Get the little endian bytes of this GUID.
pub const fn from_be_bytes(b: [u8; 16]) -> Self
Sourcepub const fn to_be_bytes(self) -> [u8; 16]
pub const fn to_be_bytes(self) -> [u8; 16]
Get the big endian bytes of this GUID.
Trait Implementations§
Source§impl FixedSized for Guid
impl FixedSized for Guid
const SERIALIZED_SIZE: usize = _
Source§impl<'raw> SubRecord<'raw> for Guid
impl<'raw> SubRecord<'raw> for Guid
const MIN_SERIALIZED_SIZE: usize = 16usize
const EXACT_SERIALIZED_SIZE: Option<usize>
Source§fn serialized_size(&self) -> usize
fn serialized_size(&self) -> usize
Exact size this will be once serialized in bytes. Read more
Source§fn _serialize_chained<W: Write>(&self, dest: &mut W) -> SeResult<usize>
fn _serialize_chained<W: Write>(&self, dest: &mut W) -> SeResult<usize>
Should only be called from generated code!
Serialize this record. It is highly recommend to use a buffered writer.
impl Copy for Guid
impl Eq for Guid
impl StructuralPartialEq for Guid
Auto Trait Implementations§
impl Freeze for Guid
impl RefUnwindSafe for Guid
impl Send for Guid
impl Sync for Guid
impl Unpin for Guid
impl UnwindSafe for Guid
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