Enum uefi::table::boot::LoadImageSource

source ·
pub enum LoadImageSource<'a> {
    FromBuffer {
        buffer: &'a [u8],
        file_path: Option<&'a DevicePath>,
    },
    FromDevicePath {
        device_path: &'a DevicePath,
        from_boot_manager: bool,
    },
}
Expand description

Used as a parameter of BootServices::load_image to provide the image source.

Variants§

§

FromBuffer

Load an image from a buffer. The data will copied from the buffer, so the input reference doesn’t need to remain valid after the image is loaded.

Fields

§buffer: &'a [u8]

Raw image data.

§file_path: Option<&'a DevicePath>

If set, this path will be added as the file path of the loaded image. This is not required to load the image, but may be used by the image itself to load other resources relative to the image’s path.

§

FromDevicePath

Load an image via the SimpleFileSystem protocol. If there is no instance of that protocol associated with the path then the behavior depends on from_boot_manager. If true, attempt to load via the LoadFile protocol. If false, attempt to load via the LoadFile2 protocol, then fall back to LoadFile.

Fields

§device_path: &'a DevicePath

The full device path from which to load the image.

The provided path should be a full device path and not just the file path portion of it. So for example, it must be (the binary representation) PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)/\\EFI\\BOOT\\BOOTX64.EFI and not just \\EFI\\BOOT\\BOOTX64.EFI.

§from_boot_manager: bool

If there is no instance of SimpleFileSystem protocol associated with the given device path, then this function will attempt to use LoadFileProtocol (from_boot_manager is true) or LoadFile2Protocol, and then LoadFileProtocol (from_boot_manager is false).

Trait Implementations§

source§

impl<'a> Debug for LoadImageSource<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for LoadImageSource<'a>

§

impl<'a> RefUnwindSafe for LoadImageSource<'a>

§

impl<'a> Send for LoadImageSource<'a>

§

impl<'a> Sync for LoadImageSource<'a>

§

impl<'a> Unpin for LoadImageSource<'a>

§

impl<'a> UnwindSafe for LoadImageSource<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.