ReplaceErr

Trait ReplaceErr 

Source
pub trait ReplaceErr: Sealed {
    type Ok;

    // Required method
    fn replace_err<F>(self, err: F) -> Result<Self::Ok, F>;
}
Expand description

Extend Result with a replace_err method.

Required Associated Types§

Source

type Ok

The type of the Ok variant in the Result.

Required Methods§

Source

fn replace_err<F>(self, err: F) -> Result<Self::Ok, F>

Replace the existing error variant with a new value.

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> ReplaceErr for Result<T, E>

Source§

type Ok = T

Source§

fn replace_err<F>(self, err: F) -> Result<<Self as ReplaceErr>::Ok, F>

Implementors§