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: LocLocation of the when keyword
case foo; when bar; end
~~~~begin_l: LocLocation of the then keyword
case foo; when bar then baz; end
~~~~then is optional, and so begin_l can be None
expression_l: LocLocation of the full expression
case foo; when bar then baz; end
~~~~~~~~~~~~~~~~~Trait Implementations
impl StructuralPartialEq for When
Auto Trait Implementations
impl RefUnwindSafe for When
impl Send for When
impl Sync for When
impl Unpin for When
impl UnwindSafe for When
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more