efibootnext/
error.rs

1//! Errors.
2
3/// An alias for the export.
4#[cfg(feature = "expose_implementation_details")]
5pub use efivar::Error as EfivarError;
6
7/// An alias for the export.
8#[cfg(feature = "expose_implementation_details")]
9pub use efi_loadopt::DecodeError as LoadOptionDecodingError;
10
11/// An error that can occur when reading load option.
12#[derive(Debug, thiserror::Error)]
13pub enum EnumerateLoadOptionsError {
14    /// Something went wrong at [`efivar`] level.
15    #[error("low-level error: {0}")]
16    Efivar(efivar::Error),
17}
18
19/// An error that can occur when reading load option.
20#[derive(Debug, thiserror::Error)]
21pub enum GetLoadOptionError {
22    /// Something went wrong at [`efivar`] level.
23    #[error("low-level error: {0}")]
24    Efivar(efivar::Error),
25    /// The `LoadOption` decoding has failed.
26    #[error("load option decoding error: {0}")]
27    LoadOptionDecoding(efi_loadopt::DecodeError),
28}
29
30/// An error that can occur when setting the boot next value.
31#[derive(Debug, thiserror::Error)]
32pub enum SetBootNextError {
33    /// Something went wrong at [`efivar`] level.
34    #[error("low-level error: {0}")]
35    Efivar(efivar::Error),
36}
37
38/// An error that can occur when setting the boot next value.
39#[derive(Debug, thiserror::Error)]
40pub enum GetBootNextError {
41    /// Something went wrong at [`efivar`] level.
42    #[error("low-level error: {0}")]
43    Efivar(efivar::Error),
44    /// The underlying value read is invalid.
45    #[error("boot next value is not valid")]
46    InvalidValue,
47}