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

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.

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.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.