pub enum ControlFlowOp<'a> {
Switch(SwitchOp<'a>),
For {
region: Region<'a>,
},
While {
before: Region<'a>,
after: Region<'a>,
},
}Expand description
A structured control-flow operation.
Variants§
Switch(SwitchOp<'a>)
Switch statement.
The first input to the switch is an integer that selects the branch by index. The operation has a region for every branch, together with an optional default region. If there is no default region, it is an error if the index does not match any branch.
For
For loop.
The loop iterates from start to stop (exclusive) by step. The region is the loop body that is executed once for each iteration. The loop maintains a state consisting of any number of values. Each iteration receives the state from the previous iteration, or the initial state for the first iteration. When the loop finishes, the final state is returned. Iterations also have access to the current iteration value.
While
While loop.
The before region is executed at least once.
If the condition is true, the after region is executed.
The loop maintains a state consisting of any number of values.
The before region receives the state from the after region,
or the initial state for the first iteration.
The after region receives the state from the before region.
When the loop finishes, the final state is returned by the before region.
Trait Implementations§
Source§impl<'a> Clone for ControlFlowOp<'a>
impl<'a> Clone for ControlFlowOp<'a>
Source§fn clone(&self) -> ControlFlowOp<'a>
fn clone(&self) -> ControlFlowOp<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for ControlFlowOp<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ControlFlowOp<'a>
impl<'a> !Send for ControlFlowOp<'a>
impl<'a> !Sync for ControlFlowOp<'a>
impl<'a> !UnwindSafe for ControlFlowOp<'a>
impl<'a> Freeze for ControlFlowOp<'a>
impl<'a> Unpin for ControlFlowOp<'a>
impl<'a> UnsafeUnpin for ControlFlowOp<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more