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 StructuralPartialEq for YulSwitch
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> 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