Skip to main content

efivar_fix/boot/
mod.rs

1//! This module handles everything related to boot entries
2
3mod boot_entry_iter;
4pub(crate) mod parse;
5mod reader;
6mod writer;
7
8pub use parse::*;
9pub use parse::{EFIHardDrive, EFIHardDriveType, FilePath, FilePathList};
10pub use reader::BootVarReader;
11pub use writer::BootVarWriter;
12
13pub trait BootVarFormat {
14    fn boot_id_format(self) -> String;
15    fn boot_var_format(self) -> String;
16}
17
18impl BootVarFormat for u16 {
19    fn boot_id_format(self) -> String {
20        format!("{self:04X}")
21    }
22
23    /// Get the boot entry name associated with that ID.
24    /// See [`crate::efi::Variable::boot_var_id`]
25    fn boot_var_format(self) -> String {
26        format!("Boot{}", self.boot_id_format())
27    }
28}