Struct gpt_disk_types::Guid
source · [−]#[repr(C)]pub struct Guid {
pub time_low: [u8; 4],
pub time_mid: [u8; 2],
pub time_high_and_version: [u8; 2],
pub clock_seq_high_and_reserved: u8,
pub clock_seq_low: u8,
pub node: [u8; 6],
}Expand description
Globally-unique identifier.
The format is described in Appendix A of the UEFI Specification. Note that the first three fields are little-endian.
Fields
time_low: [u8; 4]The little-endian low field of the timestamp.
time_mid: [u8; 2]The little-endian middle field of the timestamp.
time_high_and_version: [u8; 2]The little-endian high field of the timestamp multiplexed with the version number.
clock_seq_high_and_reserved: u8The high field of the clock sequence multiplexed with the variant.
clock_seq_low: u8The low field of the clock sequence.
node: [u8; 6]The spatially unique node identifier.
Implementations
sourceimpl Guid
impl Guid
sourcepub const ZERO: Guid = Self::new([0, 0, 0, 0], [0, 0], [0, 0], 0, 0, [0, 0, 0, 0, 0, 0])
pub const ZERO: Guid = Self::new([0, 0, 0, 0], [0, 0], [0, 0], 0, 0, [0, 0, 0, 0, 0, 0])
GUID with all fields set to zero.
sourcepub const fn new(
time_low: [u8; 4],
time_mid: [u8; 2],
time_high_and_version: [u8; 2],
clock_seq_high_and_reserved: u8,
clock_seq_low: u8,
node: [u8; 6]
) -> Guid
pub const fn new(
time_low: [u8; 4],
time_mid: [u8; 2],
time_high_and_version: [u8; 2],
clock_seq_high_and_reserved: u8,
clock_seq_low: u8,
node: [u8; 6]
) -> Guid
Create a new GUID.
sourcepub const fn try_parse(s: &str) -> Result<Guid, GuidFromStrError>
pub const fn try_parse(s: &str) -> Result<Guid, GuidFromStrError>
Parse a GUID from a string.
This is functionally the same as Guid::from_str, but is
exposed separately to provide a const method for parsing.
sourcepub const fn from_bytes(bytes: [u8; 16]) -> Guid
pub const fn from_bytes(bytes: [u8; 16]) -> Guid
Create a GUID from a 16-byte array. No changes to byte order are made.
sourcepub const fn to_ascii_hex_lower(self) -> [u8; 36]
pub const fn to_ascii_hex_lower(self) -> [u8; 36]
Convert to a lower-case hex ASCII string.
The output is in “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” format.
Trait Implementations
sourceimpl Ord for Guid
impl Ord for Guid
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Guid> for Guid
impl PartialOrd<Guid> for Guid
sourcefn partial_cmp(&self, other: &Guid) -> Option<Ordering>
fn partial_cmp(&self, other: &Guid) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
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 more
impl Copy for Guid
impl Eq for Guid
impl Pod for Guid
impl StructuralEq for Guid
impl StructuralPartialEq for Guid
Auto Trait Implementations
impl RefUnwindSafe for Guid
impl Send for Guid
impl Sync for Guid
impl Unpin for Guid
impl UnwindSafe for Guid
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<T> CheckedBitPattern for T where
T: AnyBitPattern,
impl<T> CheckedBitPattern for T where
T: AnyBitPattern,
type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during is_valid_bit_pattern. Read more
sourcefn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret bits as &Self.