Struct lib_ruby_parser::nodes::Case
source · #[repr(C)]pub struct Case {
pub expr: Option<Box<Node>>,
pub when_bodies: Vec<Node>,
pub else_body: Option<Box<Node>>,
pub keyword_l: Loc,
pub else_l: Option<Loc>,
pub end_l: Loc,
pub expression_l: Loc,
}
Expand description
Represents a case
statement (for pattern matching see CaseMatch
node)
Fields§
§expr: Option<Box<Node>>
Expression given to case
, Int("1")
for case 1; end
None
for code like
case
when pattern
end
when_bodies: Vec<Node>
A list of When
nodes (each has patterns
and body
)
else_body: Option<Box<Node>>
Body of the else
branch, None
if there’s no else
branch
keyword_l: Loc
Location of the case
keyword
case 1; end
~~~~
else_l: Option<Loc>
Location of the else
keyword
case 1; else; end
~~~~
None
if there’s no else
branch
end_l: Loc
Location of the end
keyword
case 1; end
~~~
expression_l: Loc
Location of the full expression
case 1; end
~~~~~~~~~~~
Trait Implementations§
source§impl PartialEq for Case
impl PartialEq for Case
impl StructuralPartialEq for Case
Auto Trait Implementations§
impl Freeze for Case
impl RefUnwindSafe for Case
impl Send for Case
impl Sync for Case
impl Unpin for Case
impl UnwindSafe for Case
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