[−][src]Struct r_efi::base::Guid
Globally Unique Identifiers
The Guid type represents globally unique identifiers as defined by RFC-4122 (i.e., only the
10x variant is used), with the caveat that LE is used instead of BE. The type must be 64-bit
aligned.
Note that only the binary representation of Guids is stable. You are highly recommended to interpret Guids as 128bit integers.
UEFI uses the Microsoft-style Guid format. Hence, a lot of documentation and code refers to these Guids. If you thusly cannot treat Guids as 128-bit integers, this Guid type allows you to access the individual fields of the Microsoft-style Guid. A reminder of the Guid encoding:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| time_low |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| time_mid | time_hi_and_version |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|clk_seq_hi_res | clk_seq_low | node (0-1) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| node (2-5) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The individual fields are encoded as little-endian. Accessors are provided for the Guid structure allowing access to these fields in native endian byte order.
Implementations
impl Guid[src]
pub const fn from_fields(
time_low: u32,
time_mid: u16,
time_hi_and_version: u16,
clk_seq_hi_res: u8,
clk_seq_low: u8,
node: &[u8; 6]
) -> Guid[src]
time_low: u32,
time_mid: u16,
time_hi_and_version: u16,
clk_seq_hi_res: u8,
clk_seq_low: u8,
node: &[u8; 6]
) -> Guid
Initialize a Guid from its individual fields
This function initializes a Guid object given the individual fields as specified in the UEFI specification. That is, if you simply copy the literals from the specification into your code, this function will correctly initialize the Guid object.
In other words, this takes the individual fields in native endian and converts them to the correct endianness for a UEFI Guid.
pub const fn as_fields(&self) -> (u32, u16, u16, u8, u8, &[u8; 6])[src]
Access a Guid as individual fields
This decomposes a Guid back into the individual fields as given in the specification. The individual fields are returned in native-endianness.
pub fn as_bytes(&self) -> &[u8; 16][src]
Access a Guid as raw byte array
This provides access to a Guid through a byte array. It is a simple re-interpretation of the Guid value as a 128-bit byte array. No conversion is performed. This is a simple cast.
Trait Implementations
impl Clone for Guid[src]
fn clone(&self) -> Guid[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for Guid[src]
impl Debug for Guid[src]
impl Eq for Guid[src]
impl PartialEq<Guid> for Guid[src]
impl StructuralEq for Guid[src]
impl StructuralPartialEq for Guid[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,