[][src]Enum chalk_ir::visit::ControlFlow

pub enum ControlFlow<B, C = ()> {
    Continue(C),
    Break(B),
}

An copy of the unstable std::ops::ControlFlow for use in Chalk visitors.

Variants

Continue(C)

Continue in the loop, using the given value for the next iteration

Break(B)

Exit the loop, yielding the given value

Implementations

impl<B, C> ControlFlow<B, C>[src]

pub fn is_break(&self) -> bool[src]

Returns true if this is a Break variant.

pub fn is_continue(&self) -> bool[src]

Returns true if this is a Continue variant.

pub fn break_value(self) -> Option<B>[src]

Converts the ControlFlow into an Option which is Some if the ControlFlow was Break and None otherwise.

impl<B> ControlFlow<B, ()>[src]

pub const CONTINUE: Self[src]

It's frequently the case that there's no value needed with Continue, so this provides a way to avoid typing (()), if you prefer it.

impl<C> ControlFlow<(), C>[src]

pub const BREAK: Self[src]

APIs like try_for_each don't need values with Break, so this provides a way to avoid typing (()), if you prefer it.

Auto Trait Implementations

impl<B, C> RefUnwindSafe for ControlFlow<B, C> where
    B: RefUnwindSafe,
    C: RefUnwindSafe

impl<B, C> Send for ControlFlow<B, C> where
    B: Send,
    C: Send

impl<B, C> Sync for ControlFlow<B, C> where
    B: Sync,
    C: Sync

impl<B, C> Unpin for ControlFlow<B, C> where
    B: Unpin,
    C: Unpin

impl<B, C> UnwindSafe for ControlFlow<B, C> where
    B: UnwindSafe,
    C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Cast for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.