Struct lib_ruby_parser::nodes::CaseMatch[][src]

pub struct CaseMatch {
    pub expr: Box<Node>,
    pub in_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,
}

Represents a case statement used for pattern matching (for regular case see Case node)

Fields

expr: Box<Node>

Expression given to case, Int("1") for case 1; in 1; end None for code like

case
in pattern
end
in_bodies: Vec<Node>

A list of InPattern nodes (each has pattern, guard 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; in 2; end
~~~~
else_l: Option<Loc>

Location of the else keyword

case 1; in 2; else; end
              ~~~~

None if there’s no else branch

end_l: Loc

Location of the end keyword

case 1; in 2; end
              ~~~
expression_l: Loc

Location of the full expression

case 1; in 2; end
~~~~~~~~~~~~~~~~~

Trait Implementations

impl Clone for CaseMatch[src]

impl Debug for CaseMatch[src]

impl PartialEq<CaseMatch> for CaseMatch[src]

impl StructuralPartialEq for CaseMatch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.