Struct Config

Source
pub struct Config {
Show 14 fields pub title: Option<String>, pub version: Option<String>, pub machine_id: Option<MachineId>, pub sort_key: Option<SortKey>, pub options: Option<String>, pub devicetree_path: Option<DevicetreePath>, pub architecture: Option<Architecture>, pub efi_path: Option<EfiPath>, pub action: BootAction, pub bad: bool, pub fs_handle: Option<FsHandle>, pub origin: Option<Parsers>, pub filename: String, pub suffix: String,
}
Expand description

The standard Config

Fields§

§title: Option<String>

The preferred boot name of the entry.

§version: Option<String>

The version of the entry for sorting.

§machine_id: Option<MachineId>

The machine-id for sorting.

§sort_key: Option<SortKey>

The sort-key for sorting.

§options: Option<String>

The options specified in loading the image.

§devicetree_path: Option<DevicetreePath>

The path to a devicetree, if one is required.

§architecture: Option<Architecture>

The architecture of the entry for filtering.

§efi_path: Option<EfiPath>

The path to an EFI executable, if one is required.

§action: BootAction

The BootAction of the entry, for deciding which loader to use.

§bad: bool

Checks if an entry is bad, for sorting and deranking.

This does not necessarily mean that it’s invalid, only that it’s known to fail.

§fs_handle: Option<FsHandle>

The FsHandle of the entry, if one is required.

§origin: Option<Parsers>

The parser from which the entry originated from, if there was one.

§filename: String

The filename of the entry.

§suffix: String

The suffix of the filename of the entry.

Implementations§

Source§

impl Config

Source

pub fn get_str_fields( &self, ) -> impl Iterator<Item = (&'static str, Option<&str>)>

Returns an iterator over every String struct field that should be edited

Source

pub fn is_good(&self) -> bool

Verifies if a Config is good. If the Config is good, then it will return true. Otherwise, it will return false.

Source

pub fn get_preferred_title(&self, option: Option<usize>) -> String

Picks the preferred title for a Config using one of three sources.

If the title of the Config is found, then that is used and preferred because it indicates the preferred name for the boot option. If the title is not present, and the filename is not empty, then the filename is used. This is because it can still indicate the source of a particular boot option or its origin. If the filename is empty, then the index of the boot option is used. This is because at least some way of differentiating the boot option from other boot options is required. This will only be the case if the index is provided.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more
Source§

impl From<&Config> for ConfigBuilder

Source§

fn from(value: &Config) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl !Send for Config

§

impl !Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.