pub struct YulSwitch {
pub switch_token: switch,
pub selector: YulExpr,
pub branches: Vec<YulCaseBranch>,
pub default_case: Option<YulSwitchDefault>,
}
Expand description
A Yul switch statement can consist of only a default-case or one or more non-default cases optionally followed by a default-case.
Example switch statement in Yul:
switch exponent
case 0 { result := 1 }
case 1 { result := base }
default { revert(0, 0) }
Solidity Reference: https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.yulSwitchStatement
Fields§
§switch_token: switch
§selector: YulExpr
§branches: Vec<YulCaseBranch>
§default_case: Option<YulSwitchDefault>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for YulSwitch
impl RefUnwindSafe for YulSwitch
impl !Send for YulSwitch
impl !Sync for YulSwitch
impl Unpin for YulSwitch
impl UnwindSafe for YulSwitch
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 108 bytes