Struct lib_ruby_parser::nodes::When
source · #[repr(C)]pub struct When {
pub patterns: Vec<Node>,
pub body: Option<Box<Node>>,
pub keyword_l: Loc,
pub begin_l: Loc,
pub expression_l: Loc,
}
Expand description
Represents a branch of the case
statement (i.e. when foo
)
Fields§
§patterns: Vec<Node>
A list of values to compare/match against
body: Option<Box<Node>>
Body of the when
branch
keyword_l: Loc
Location of the when
keyword
case foo; when bar; end
~~~~
begin_l: Loc
Location of the then
keyword
case foo; when bar then baz; end
~~~~
then
is optional, and so begin_l
can be None
expression_l: Loc
Location of the full expression
case foo; when bar then baz; end
~~~~~~~~~~~~~~~~~
Trait Implementations§
source§impl PartialEq for When
impl PartialEq for When
impl StructuralPartialEq for When
Auto Trait Implementations§
impl Freeze for When
impl RefUnwindSafe for When
impl Send for When
impl Sync for When
impl Unpin for When
impl UnwindSafe for When
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