Skip to main content

Try

Trait Try 

Source
pub trait Try {
    type Output;
    type Residual;

    // Required methods
    fn from_output(output: Self::Output) -> Self;
    fn from_residual(residual: Self::Residual) -> Self;
    fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
}
Expand description

Clone of std::ops::Try.

Implementing this trait is not permitted outside of rayon.

Required Associated Types§

Required Methods§

Source

fn from_output(output: Self::Output) -> Self

Source

fn from_residual(residual: Self::Residual) -> Self

Source

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<B, C> Try for ControlFlow<B, C>

Source§

type Output = C

Source§

type Residual = ControlFlow<B, Infallible>

Source§

fn from_output(output: Self::Output) -> Self

Source§

fn from_residual(residual: Self::Residual) -> Self

Source§

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

Source§

impl<T, E> Try for Poll<Option<Result<T, E>>>

Source§

type Output = Poll<Option<T>>

Source§

type Residual = Result<Infallible, E>

Source§

fn from_output(output: Self::Output) -> Self

Source§

fn from_residual(residual: Self::Residual) -> Self

Source§

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

Source§

impl<T, E> Try for Poll<Result<T, E>>

Source§

type Output = Poll<T>

Source§

type Residual = Result<Infallible, E>

Source§

fn from_output(output: Self::Output) -> Self

Source§

fn from_residual(residual: Self::Residual) -> Self

Source§

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

Source§

impl<T, E> Try for Result<T, E>

Source§

type Output = T

Source§

type Residual = Result<Infallible, E>

Source§

fn from_output(output: Self::Output) -> Self

Source§

fn from_residual(residual: Self::Residual) -> Self

Source§

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

Source§

impl<T> Try for Option<T>

Source§

type Output = T

Source§

type Residual = Option<Infallible>

Source§

fn from_output(output: Self::Output) -> Self

Source§

fn from_residual(residual: Self::Residual) -> Self

Source§

fn branch(self) -> ControlFlow<Self::Residual, Self::Output>

Implementors§