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

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

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Cast for T[src]

fn cast<U>(self, interner: &U::Interner) -> U where
    Self: CastTo<U>,
    U: HasInterner
[src]

Cast a value to type U using CastTo.

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.