Struct lib_ruby_parser::nodes::ConstPattern
source · [−]#[repr(C)]pub struct ConstPattern {
pub const_: Box<Node>,
pub pattern: Box<Node>,
pub begin_l: Loc,
pub end_l: Loc,
pub expression_l: Loc,
}
Expand description
Const pattern used in pattern matching (e.g. in A(1, 2)
)
Fields
const_: Box<Node>
Constant that is used, Const("Foo")
for in For(42)
pattern: Box<Node>
Inner part of the constant pattern
ArrayPattern(vec![ Int("1") ])
for Foo(1)
begin_l: Loc
Location of the open parenthesis
case 1; in Foo(42); end
~
end_l: Loc
Location of the closing parenthesis
case 1; in Foo(42); end
~
expression_l: Loc
Location of the full expression
case 1; in Foo(42); end
~~~~~~~
Trait Implementations
sourceimpl Clone for ConstPattern
impl Clone for ConstPattern
sourcefn clone(&self) -> ConstPattern
fn clone(&self) -> ConstPattern
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConstPattern
impl Debug for ConstPattern
sourceimpl PartialEq<ConstPattern> for ConstPattern
impl PartialEq<ConstPattern> for ConstPattern
sourcefn eq(&self, other: &ConstPattern) -> bool
fn eq(&self, other: &ConstPattern) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ConstPattern) -> bool
fn ne(&self, other: &ConstPattern) -> bool
This method tests for !=
.
impl StructuralPartialEq for ConstPattern
Auto Trait Implementations
impl RefUnwindSafe for ConstPattern
impl Send for ConstPattern
impl Sync for ConstPattern
impl Unpin for ConstPattern
impl UnwindSafe for ConstPattern
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