Skip to main content

Verdict

Type Alias Verdict 

Source
pub type Verdict<T, W> = Result<Caveat<T, W>, ErrorSet<W>>;
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, W> {
    Ok(Caveat<T, W>),
    Err(ErrorSet<W>),
}

Variants§

§1.0.0

Ok(Caveat<T, W>)

Contains the success value

§1.0.0

Err(ErrorSet<W>)

Contains the error value

Trait Implementations§

Source§

impl<T, W: Warning> VerdictExt<T, W> for Verdict<T, W>

Source§

fn map_caveat<F, U>(self, op: F) -> Verdict<U, W>
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 only_error(self) -> Result<Caveat<T, W>, Error<W>>

Discard all warnings in the Err variant and keep only the warning that caused the error.