Trait ResultExt

Source
pub trait ResultExt<T>: Sealed {
    // Required methods
    fn with_kind(self, kind: ErrorKind) -> Result<T>;
    fn with_context<C>(self, kind: ErrorKind, message: C) -> Result<T>
       where Self: Sized,
             C: Into<Cow<'static, str>>;
    fn with_context_fn<F, C>(self, kind: ErrorKind, f: F) -> Result<T>
       where Self: Sized,
             F: FnOnce() -> C,
             C: Into<Cow<'static, str>>;
}

Required Methods§

Source

fn with_kind(self, kind: ErrorKind) -> Result<T>

Source

fn with_context<C>(self, kind: ErrorKind, message: C) -> Result<T>
where Self: Sized, C: Into<Cow<'static, str>>,

Source

fn with_context_fn<F, C>(self, kind: ErrorKind, f: F) -> Result<T>
where Self: Sized, F: FnOnce() -> C, C: Into<Cow<'static, str>>,

Implementations on Foreign Types§

Source§

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

Source§

fn with_kind(self, kind: ErrorKind) -> Result<T>

Source§

fn with_context<C>(self, kind: ErrorKind, message: C) -> Result<T>
where Self: Sized, C: Into<Cow<'static, str>>,

Source§

fn with_context_fn<F, C>(self, kind: ErrorKind, f: F) -> Result<T>
where Self: Sized, F: FnOnce() -> C, C: Into<Cow<'static, str>>,

Implementors§