Struct lib_ruby_parser::nodes::CaseMatch [−][src]
#[repr(C)]pub struct CaseMatch { pub expr: Ptr<Node>, pub in_bodies: List<Node>, pub else_body: MaybePtr<Node>, pub keyword_l: Loc, pub else_l: MaybeLoc, pub end_l: Loc, pub expression_l: Loc, }
Represents a case statement used for pattern matching (for regular case see Case node)
Fields
expr: Ptr<Node>Expression given to case, Int("1") for case 1; in 1; end
None for code like
case
in pattern
end
in_bodies: List<Node>A list of InPattern nodes (each has pattern, guard and body)
else_body: MaybePtr<Node>Body of the else branch, None if there’s no else branch
keyword_l: LocLocation of the case keyword
case 1; in 2; end
~~~~
else_l: MaybeLocLocation of the else keyword
case 1; in 2; else; end
~~~~
None if there’s no else branch
end_l: LocLocation of the end keyword
case 1; in 2; end
~~~
expression_l: LocLocation 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
impl RefUnwindSafe for CaseMatch
impl Send for CaseMatch
impl Sync for CaseMatch
impl Unpin for CaseMatch
impl UnwindSafe for CaseMatch
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,