pub struct LoadFile(/* private fields */);Expand description
Load File Protocol.
Used to obtain files, that are primarily boot options, from arbitrary devices.
§UEFI Spec Description
The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
When the firmware is attempting to load a file, it first attempts to use the device’s Simple File System protocol to read the file. If the file system protocol is found, the firmware implements the policy of interpreting the File Path value of the file being loaded. If the device does not support the file system protocol, the firmware then attempts to read the file via the EFI_LOAD_FILE_PROTOCOL and the LoadFile() function. In this case the LoadFile() function implements the policy of interpreting the File Path value.
Implementations§
Source§impl LoadFile
impl LoadFile
Sourcepub fn load_file<'a>(
&mut self,
file_path: &DevicePath,
boot_policy: BootPolicy,
) -> Result<Box<[u8]>>
Available on crate feature alloc only.
pub fn load_file<'a>( &mut self, file_path: &DevicePath, boot_policy: BootPolicy, ) -> Result<Box<[u8]>>
alloc only.Causes the driver to load a specified file.
§Arguments
file_pathThe device specific path of the file to load.boot_policyTheBootPolicyto use.
§Errors
Status::SUCCESSThe file was loaded.Status::UNSUPPORTEDThe device does not support the provided BootPolicy.Status::INVALID_PARAMETERFilePath is not a valid device path, or BufferSize is NULL.Status::NO_MEDIANo medium was present to load the file.Status::DEVICE_ERRORThe file was not loaded due to a device error.Status::NO_RESPONSEThe remote system did not respond.Status::NOT_FOUNDThe file was not found.Status::ABORTEDThe file load process was manually cancelled.Status::BUFFER_TOO_SMALLThe BufferSize is too small to read the current directory entry. BufferSize has been updated with the size needed to complete the request.Status::WARN_FILE_SYSTEMThe resulting Buffer contains UEFI-compliant file system.