Struct BootMgr

Source
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

Source

pub fn new() -> BootResult<Self>

Creates a new BootMgr, load drivers, then populate it with Configs.

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 Configs.

Source

pub fn load(&mut self, selected: usize) -> BootResult<Handle>

Load a boot option from a Config given the index.

§Errors

May return an Error if an error occurred while loading the boot option.

Source

pub const fn list(&self) -> &Vec<Config>

Returns a reference to the inner Vec<Config>.

Source

pub const fn list_mut(&mut self) -> &mut Vec<Config>

Returns a mutable reference to the inner Vec<Config>.

Source

pub fn get_config(&mut self, option: usize) -> &mut Config

Returns a mutable reference to an inner Config.

Source

pub fn get_default(&self) -> usize

Gets the default boot option.

If the default boot option is not set, then 0 is returned

Source

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.

Source

pub fn validate(&mut self)

Validates the inner Vec<Config> through various criteria.

If any of the Configs are found to be invalid, then they will be filtered.

Auto Trait Implementations§

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

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.