Skip to main content

ResultExt

Trait ResultExt 

Source
pub trait ResultExt<T, E>: Sized {
    // Required methods
    fn extend_err<C>(self, cb: C) -> Result<T>
       where C: FnOnce(&E, &mut ErrorExtensionValues);
    fn extend(self) -> Result<T>;
}
Expand description

Extend a Result’s error value with ErrorExtensions.

Required Methods§

Source

fn extend_err<C>(self, cb: C) -> Result<T>
where C: FnOnce(&E, &mut ErrorExtensionValues),

Extend the error value of the result with the callback.

Source

fn extend(self) -> Result<T>

Extend the result to a Result.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, E> ResultExt<T, E> for Result<T, E>
where E: ErrorExtensions + Send + Sync + 'static,

Source§

fn extend_err<C>(self, cb: C) -> Result<T>
where C: FnOnce(&E, &mut ErrorExtensionValues),

Source§

fn extend(self) -> Result<T>

Implementors§