Trait error_chain::example_generated::ResultExt [−][src]
Additional methods for Result
, 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>,
[src]
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> ResultExt<T> for Result<T, E> where
E: Error + Send + 'static,
[src]
E: Error + Send + 'static,
fn chain_err<F, EK>(self, callback: F) -> Result<T, Error> where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
[src]
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
impl<T> ResultExt<T> for Option<T>
[src]
fn chain_err<F, EK>(self, callback: F) -> Result<T, Error> where
F: FnOnce() -> EK,
EK: Into<ErrorKind>,
[src]
F: FnOnce() -> EK,
EK: Into<ErrorKind>,