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:
casesis guaranteed to be aVecofYulSwitchOptions::Case.defaultis guaranteed to beYulSwitchOptions::Default.- At least one of
casesordefaultmust be non-empty/Somerespectively.
Fields§
§loc: LocThe code location.
condition: YulExpressionThe 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
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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