[−][src]Trait tract_nnef::internal::TractResultExt
Additional methods for Result
, for easy interaction with this crate.
Required methods
fn chain_err<F, EK>(self, callback: F) -> Result<T, TractError> where
EK: Into<TractErrorKind>,
F: FnOnce() -> EK,
EK: Into<TractErrorKind>,
F: FnOnce() -> EK,
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.
Implementors
impl<T> TractResultExt<T> for Option<T>
[src]
fn chain_err<F, EK>(self, callback: F) -> Result<T, TractError> where
EK: Into<TractErrorKind>,
F: FnOnce() -> EK,
[src]
EK: Into<TractErrorKind>,
F: FnOnce() -> EK,
impl<T, E> TractResultExt<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, TractError> where
EK: Into<TractErrorKind>,
F: FnOnce() -> EK,
[src]
EK: Into<TractErrorKind>,
F: FnOnce() -> EK,