pub enum Terminator {
Jump(BlockId),
Branch {
condition: ValueId,
then_block: BlockId,
else_block: BlockId,
},
Switch {
value: ValueId,
default: BlockId,
cases: Vec<(ValueId, BlockId)>,
},
Return {
values: SmallVec<[ValueId; 2]>,
},
Revert {
offset: ValueId,
size: ValueId,
},
ReturnData {
offset: ValueId,
size: ValueId,
},
Stop,
SelfDestruct {
recipient: ValueId,
},
Invalid,
}Expand description
A block terminator instruction.
Variants§
Jump(BlockId)
Unconditional jump to another block.
Branch
Conditional branch.
Fields
Switch
Multi-way switch.
Fields
Return
Return from function.
Revert
Revert execution.
ReturnData
Return raw, already-encoded data: RETURN(offset, size). Used for
ABI-encoded external returns whose size is computed at runtime.
Fields
Stop
Stop execution.
SelfDestruct
Self-destruct the contract.
Invalid
Invalid operation (unreachable code).
Implementations§
Source§impl Terminator
impl Terminator
Sourcepub fn successors(&self) -> SmallVec<[BlockId; 2]>
pub fn successors(&self) -> SmallVec<[BlockId; 2]>
Returns the successor blocks of this terminator.
Trait Implementations§
Source§impl Clone for Terminator
impl Clone for Terminator
Source§fn clone(&self) -> Terminator
fn clone(&self) -> Terminator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Terminator
impl Debug for Terminator
Source§impl Display for Terminator
impl Display for Terminator
Source§impl PartialEq for Terminator
impl PartialEq for Terminator
Source§fn eq(&self, other: &Terminator) -> bool
fn eq(&self, other: &Terminator) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Terminator
Auto Trait Implementations§
impl Freeze for Terminator
impl RefUnwindSafe for Terminator
impl Send for Terminator
impl Sync for Terminator
impl Unpin for Terminator
impl UnsafeUnpin for Terminator
impl UnwindSafe for Terminator
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
Converts
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> ⓘ
Converts
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