Struct solang_parser::pt::YulSwitch
source · pub struct YulSwitch {
pub loc: Loc,
pub condition: YulExpression,
pub cases: Vec<YulSwitchOptions>,
pub default: Option<YulSwitchOptions>,
}
Expand description
A Yul switch statement.
switch <condition> <cases>* [default <default>]
Enforced by the parser:
cases
is guaranteed to be aVec
ofYulSwitchOptions::Case
.default
is guaranteed to beYulSwitchOptions::Default
.- At least one of
cases
ordefault
must be non-empty/Some
respectively.
Fields§
§loc: Loc
The code location.
condition: YulExpression
The switch condition.
cases: Vec<YulSwitchOptions>
The switch cases.
default: Option<YulSwitchOptions>
The optional default case.
Trait Implementations§
source§impl OptionalCodeLocation for YulSwitch
impl OptionalCodeLocation for YulSwitch
source§impl PartialEq for YulSwitch
impl PartialEq for YulSwitch
impl Eq for YulSwitch
impl StructuralEq for YulSwitch
impl StructuralPartialEq for YulSwitch
Auto Trait Implementations§
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