Skip to main content

VerdictExt

Trait VerdictExt 

Source
pub trait VerdictExt<T, K: Kind> {
    // Required methods
    fn map_caveat<F, U>(self, op: F) -> Verdict<U, K>
       where F: FnOnce(T) -> U;
    fn keep_cause(self, root: &Element<'_>) -> Result<Caveat<T, K>, Cause<K>>;
}
Expand description

Verdict specific extension methods for the Result type.

Required Methods§

Source

fn map_caveat<F, U>(self, op: F) -> Verdict<U, K>
where F: FnOnce(T) -> U,

Maps a Verdict<T, E> to Verdict<U, E> by applying a function to a contained Ok value, leaving an Err value untouched.

Source

fn keep_cause(self, root: &Element<'_>) -> Result<Caveat<T, K>, Cause<K>>

Discard all warnings in the Err variant and keep only the warning that caused the 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.

Implementors§

Source§

impl<T, K: Kind> VerdictExt<T, K> for Verdict<T, K>
where T: IntoCaveat,