Trait uefi::prelude::ResultExt [−][src]
pub trait ResultExt<Output, ErrData: Debug> {
fn status(&self) -> Status;
fn log_warning(self) -> Result<Output, Error<ErrData>>;
fn unwrap_success(self) -> Output;
fn expect_success(self, msg: &str) -> Output;
fn expect_error(self, msg: &str) -> Error<ErrData>;
fn map_inner<Mapped>(
self,
f: impl FnOnce(Output) -> Mapped
) -> Result<Mapped, ErrData>;
fn discard_errdata(self) -> Result<Output>;
fn warning_as_error(self) -> Result<Output, Error<ErrData>>
where
ErrData: Default;
}
Expand description
Extension trait for Result which helps dealing with UEFI’s warnings
Required methods
fn log_warning(self) -> Result<Output, Error<ErrData>>
fn log_warning(self) -> Result<Output, Error<ErrData>>
Ignore warnings, keeping a trace of them in the logs
fn unwrap_success(self) -> Output
fn unwrap_success(self) -> Output
Expect success without warnings, panic otherwise
fn expect_success(self, msg: &str) -> Output
fn expect_success(self, msg: &str) -> Output
Expect success without warnings, panic with provided message otherwise
fn expect_error(self, msg: &str) -> Error<ErrData>
fn expect_error(self, msg: &str) -> Error<ErrData>
Expect error, panic with provided message otherwise, discarding output
Transform the inner output, if any
fn discard_errdata(self) -> Result<Output>
fn discard_errdata(self) -> Result<Output>
Transform the ErrData value to ()
fn warning_as_error(self) -> Result<Output, Error<ErrData>> where
ErrData: Default,
fn warning_as_error(self) -> Result<Output, Error<ErrData>> where
ErrData: Default,
Treat warnings as errors