[][src]Trait uefi::ResultExt

pub trait ResultExt<Output, ErrData: Debug> {
    pub fn status(&self) -> Status;
pub fn log_warning(self) -> Result<Output, Error<ErrData>>;
pub fn unwrap_success(self) -> Output;
pub fn expect_success(self, msg: &str) -> Output;
pub fn expect_error(self, msg: &str) -> Error<ErrData>;
pub fn map_inner<Mapped>(
        self,
        f: impl FnOnce(Output) -> Mapped
    ) -> Result<Mapped, ErrData>;
pub fn discard_errdata(self) -> Result<Output>;
pub fn warning_as_error(self) -> Result<Output, Error<ErrData>>
    where
        ErrData: Default
; }

Extension trait for Result which helps dealing with UEFI's warnings

Required methods

pub fn status(&self) -> Status[src]

Extract the UEFI status from this result

pub fn log_warning(self) -> Result<Output, Error<ErrData>>[src]

Ignore warnings, keeping a trace of them in the logs

pub fn unwrap_success(self) -> Output[src]

Expect success without warnings, panic otherwise

pub fn expect_success(self, msg: &str) -> Output[src]

Expect success without warnings, panic with provided message otherwise

pub fn expect_error(self, msg: &str) -> Error<ErrData>[src]

Expect error, panic with provided message otherwise, discarding output

pub fn map_inner<Mapped>(
    self,
    f: impl FnOnce(Output) -> Mapped
) -> Result<Mapped, ErrData>
[src]

Transform the inner output, if any

pub fn discard_errdata(self) -> Result<Output>[src]

Transform the ErrData value to ()

pub fn warning_as_error(self) -> Result<Output, Error<ErrData>> where
    ErrData: Default
[src]

Treat warnings as errors

Loading content...

Implementors

impl<Output, ErrData: Debug> ResultExt<Output, ErrData> for Result<Output, ErrData>[src]

Loading content...