Module helper

Source
Expand description

Various helper functions for other modules.

§Safety

This module uses unsafe in 2 places.

  1. MaybeUninit<T> provides guarantees that its size and layout will be exactly the same as T. Because of this, it is safe to interpret a pointer of type T as a pointer of type MaybeUninit<T> (note: the opposite is not always true). Because of this, this is essentially reconstructing a pointer from itself, which is safe.
  2. The timer is created with no callbacks. This means that it is safe, since there are no callbacks that need to specially handle ExitBootServices.

Enums§

DevicePathError
An Error that may result from building a DevicePath
StrError
An Error that may result from converting a String to another format.

Functions§

create_timer
Create a timer that will fire every duration in milliseconds.
get_arch
Gets the target architecture of the bootloader binary.
locate_protocol
Open a protocol given a type implementing ProtocolPointer.