Trait VisitorResult

Source
pub trait VisitorResult {
    type T;
    type Residual;

    // Required methods
    fn output() -> Self;
    fn from_residual(residual: Self::Residual) -> Self;
    fn from_branch(b: ControlFlow<Self::Residual, Self::T>) -> Self;
    fn branch(self) -> ControlFlow<Self::Residual, Self::T>;
}

Required Associated Types§

Required Methods§

Source

fn output() -> Self

Source

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

Source

fn from_branch(b: ControlFlow<Self::Residual, Self::T>) -> Self

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl VisitorResult for ()

Source§

type T = ()

Source§

type Residual = Infallible

Source§

fn output() -> Self

Source§

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

Source§

fn from_branch(_b: ControlFlow<Self::Residual>) -> Self

Source§

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

Source§

impl<B, C: Default> VisitorResult for ControlFlow<B, C>

Source§

type T = C

Source§

type Residual = B

Source§

fn output() -> Self

Source§

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

Source§

fn from_branch(b: ControlFlow<Self::Residual, Self::T>) -> Self

Source§

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

Source§

impl<T> VisitorResult for Option<T>

Source§

type T = T

Source§

type Residual = ()

Source§

fn output() -> Self

Source§

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

Source§

fn from_branch(b: ControlFlow<Self::Residual, Self::T>) -> Self

Source§

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

Source§

impl<T: Default, E> VisitorResult for Result<T, E>

Source§

type T = T

Source§

type Residual = E

Source§

fn output() -> Self

Source§

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

Source§

fn from_branch(b: ControlFlow<Self::Residual, Self::T>) -> Self

Source§

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

Implementors§