util::error

Trait Result

Source
pub trait Result<T, E> {
    // Required method
    fn chain_err<F, EK>(self, callback: F) -> Result<T, YabsError>
       where F: FnOnce() -> EK,
             EK: Into<YabsErrorKind>;
}
Expand description

Additional methods for Result, for easy interaction with this crate.

Required Methods§

Source

fn chain_err<F, EK>(self, callback: F) -> Result<T, YabsError>
where F: FnOnce() -> EK, EK: Into<YabsErrorKind>,

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T, E> Result<T, E> for Result<T, E>
where E: Error + Send + 'static,

Source§

fn chain_err<F, EK>(self, callback: F) -> Result<T, YabsError>
where F: FnOnce() -> EK, EK: Into<YabsErrorKind>,

Implementors§