Struct r_efi::base::Guid [−][src]
#[repr(C, align(8))]pub struct Guid { /* fields omitted */ }
Expand description
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
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
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]
) -> GuidInitialize 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.
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.