VisitorResult in rustc_ast::visit - Rust (original) (raw)

rustc_ast::visit

Trait VisitorResult

Source

pub trait VisitorResult {
    type Residual;

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

Expand description

Similar to the Try trait, but also implemented for ().

Required Associated Types§

Source

type Residual

Required Methods§

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>

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 Residual = !

Source§

fn output()

Source§

fn from_residual(_: !)

Source§

fn from_branch(_: ControlFlow<!>)

Source§

fn branch(self) -> ControlFlow<!>

Source§

impl VisitorResult for ControlFlow

Source§

type Residual = T

Source§

fn output() -> ControlFlow

Source§

fn from_residual(residual: T) -> ControlFlow

Source§

fn from_branch(b: ControlFlow) -> ControlFlow

Source§

fn branch(self) -> ControlFlow

Implementors§