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