pub struct BootMgr {
pub boot_config: BootConfig,
/* private fields */
}
Expand description
The storage for configuration files.
Fields§
§boot_config: BootConfig
The configuration of the boot manager.
Implementations§
Source§impl BootMgr
impl BootMgr
Sourcepub fn new() -> BootResult<Self>
pub fn new() -> BootResult<Self>
Creates a new BootMgr
, load drivers, then populate it with Config
s.
It will also add special boot options, like Reboot, Shutdown, and Reset to Firmware.
This will also parse the main configuration file located at \\loader\\bootmgr-rs.conf
for user settings.
§Errors
May return an Error
if a fatal error occurred when parsing the BootConfig
(such as the image handle not
supporting SimpleFileSystem
) or when parsing the Config
s.
Sourcepub fn load(&mut self, selected: usize) -> BootResult<Handle>
pub fn load(&mut self, selected: usize) -> BootResult<Handle>
Sourcepub const fn list(&self) -> &Vec<Config>
pub const fn list(&self) -> &Vec<Config>
Returns a reference to the inner Vec<Config>
.
Sourcepub const fn list_mut(&mut self) -> &mut Vec<Config>
pub const fn list_mut(&mut self) -> &mut Vec<Config>
Returns a mutable reference to the inner Vec<Config>
.
Sourcepub fn get_config(&mut self, option: usize) -> &mut Config
pub fn get_config(&mut self, option: usize) -> &mut Config
Returns a mutable reference to an inner Config
.
Sourcepub fn get_default(&self) -> usize
pub fn get_default(&self) -> usize
Gets the default boot option.
If the default boot option is not set, then 0 is returned
Sourcepub fn set_default(&self, option: usize)
pub fn set_default(&self, option: usize)
Sets the default boot option by index.
This is stored in a UEFI variable. Due to the poor quality of how UEFI variables are stored sometimes, this cannot be completely reliable across all firmware implementations.
Sourcepub fn validate(&mut self)
pub fn validate(&mut self)
Validates the inner Vec<Config>
through various criteria.
If any of the Config
s are found to be invalid, then they will be
filtered.