Skip to main content

OutcomeError

Trait OutcomeError 

Source
pub trait OutcomeError {
    type Error;

    // Required method
    fn consume(self) -> (Option<Outcome>, Self::Error);
}
Expand description

An error which can be extracted into an outcome.

Required Associated Types§

Source

type Error

Produced error, without attached outcome.

Required Methods§

Source

fn consume(self) -> (Option<Outcome>, Self::Error)

Consumes the error and returns an outcome and Self::Error.

Returning a None outcome should discard the item(s) silently.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl OutcomeError for Infallible

Source§

type Error = Infallible

Source§

fn consume(self) -> (Option<Outcome>, Self::Error)

Source§

impl OutcomeError for Option<Outcome>

Source§

type Error = ()

Source§

fn consume(self) -> (Option<Outcome>, Self::Error)

Source§

impl<E> OutcomeError for (Option<Outcome>, E)

Source§

type Error = E

Source§

fn consume(self) -> (Option<Outcome>, Self::Error)

Source§

impl<E> OutcomeError for (Outcome, E)

Source§

type Error = E

Source§

fn consume(self) -> (Option<Outcome>, Self::Error)

Implementors§