Trait udi::ResultExt [−][src]
pub trait ResultExt<__T> { fn chain_err<__F, __EK>(self, callback: __F) -> Result<__T, Error>
where
__F: FnOnce() -> __EK,
__EK: Into<ErrorKind>; }
Additional methods for Result
and Option
, for easy interaction with this crate.
Required Methods
fn chain_err<__F, __EK>(self, callback: __F) -> Result<__T, Error> where
__F: FnOnce() -> __EK,
__EK: Into<ErrorKind>,
__F: FnOnce() -> __EK,
__EK: Into<ErrorKind>,
If the Result
is an Err
then chain_err
evaluates the closure, which returns some type that can be converted to ErrorKind
, boxes the original error to store as the cause, then returns a new error containing the original error.
Implementations on Foreign Types
impl<__T, __E: Error + Send + 'static> ResultExt<__T> for Result<__T, __E>
[src]
impl<__T, __E: Error + Send + 'static> ResultExt<__T> for Result<__T, __E>
impl<__T> ResultExt<__T> for Option<__T>
[src]
impl<__T> ResultExt<__T> for Option<__T>