Skip to main content

Fallible

Trait Fallible 

Source
pub trait Fallible: TaskName {
    type Ok: Send + 'static;
    type Err: Send + 'static;

    // Required methods
    fn from_ok(value: Self::Ok) -> Self::Output;
    fn from_err(error: Self::Err) -> Self::Output;
}
Expand description

A name whose output is a Result, so a test can fail it with the error type. Implemented for every such name; asking to fail any other name does not compile.

Required Associated Types§

Source

type Ok: Send + 'static

The success type.

Source

type Err: Send + 'static

The error type.

Required Methods§

Source

fn from_ok(value: Self::Ok) -> Self::Output

The output for a success.

Source

fn from_err(error: Self::Err) -> Self::Output

The output for a failure.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<N, T, E> Fallible for N
where N: TaskName<Output = Result<T, E>>, T: Send + 'static, E: Send + 'static,

Source§

type Ok = T

Source§

type Err = E