Verdict

Type Alias Verdict 

Source
pub type Verdict<T, K> = Result<Caveat<T, K>, Set<K>>;
Expand description

A Verdict is a standard Result with Warnings potentially issued for both the Ok and Err variants.

Aliased Type§

pub enum Verdict<T, K> {
    Ok(Caveat<T, K>),
    Err(Set<K>),
}

Variants§

§1.0.0

Ok(Caveat<T, K>)

Contains the success value

§1.0.0

Err(Set<K>)

Contains the error value

Trait Implementations§

Source§

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

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.