Enum valkyrie_ast::PatternNode
source · pub enum PatternNode {
Symbol(Box<ArgumentKey>),
Tuple(Box<TuplePatternNode>),
Class(Box<ClassPatternNode>),
Union(Box<UnionPatternNode>),
Array(Box<ArrayPatternNode>),
Atom(Box<IdentifierPattern>),
}
Expand description
let a, b = expr
let (a, b) = expr
let [a, b, **args] = expr
let Named(a, b) = expr
let Named {a, b, ***kws} = expr
let Named(Struct {a: b, b}, b, **args) = expr
let i = 1;
let j = 1;
let mut i, mut j;
let [a, b]
let (a, b)
case Some(a)
| Success { value: a }
| Extractor { a, b: _, *** }
| [a, b: _, **arg, ***kws]
when a > 0
& a is Integer:
do something
for i in range;
for i, j in range;
for mut i, mut j in range
for [tuple] in
Variants§
Symbol(Box<ArgumentKey>)
a, 'string', number, bool
Tuple(Box<TuplePatternNode>)
(mut a, mut b)
Class(Box<ClassPatternNode>)
{ mut a: b, mut c: d }
Union(Box<UnionPatternNode>)
Some(a) | Success { value: a }
Array(Box<ArrayPatternNode>)
[a, b, **]
Atom(Box<IdentifierPattern>)
#macro mod id
Trait Implementations§
source§impl Clone for PatternNode
impl Clone for PatternNode
source§fn clone(&self) -> PatternNode
fn clone(&self) -> PatternNode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PatternNode
impl Debug for PatternNode
source§impl From<ArgumentKey> for PatternNode
impl From<ArgumentKey> for PatternNode
source§fn from(o: ArgumentKey) -> Self
fn from(o: ArgumentKey) -> Self
Converts to this type from the input type.
source§impl From<ArrayPatternNode> for PatternNode
impl From<ArrayPatternNode> for PatternNode
source§fn from(o: ArrayPatternNode) -> Self
fn from(o: ArrayPatternNode) -> Self
Converts to this type from the input type.
source§impl From<ClassPatternNode> for PatternNode
impl From<ClassPatternNode> for PatternNode
source§fn from(o: ClassPatternNode) -> Self
fn from(o: ClassPatternNode) -> Self
Converts to this type from the input type.
source§impl From<IdentifierPattern> for PatternNode
impl From<IdentifierPattern> for PatternNode
source§fn from(o: IdentifierPattern) -> Self
fn from(o: IdentifierPattern) -> Self
Converts to this type from the input type.
source§impl From<TuplePatternNode> for PatternNode
impl From<TuplePatternNode> for PatternNode
source§fn from(o: TuplePatternNode) -> Self
fn from(o: TuplePatternNode) -> Self
Converts to this type from the input type.
source§impl From<UnionPatternNode> for PatternNode
impl From<UnionPatternNode> for PatternNode
source§fn from(o: UnionPatternNode) -> Self
fn from(o: UnionPatternNode) -> Self
Converts to this type from the input type.
source§impl Hash for PatternNode
impl Hash for PatternNode
source§impl PartialEq for PatternNode
impl PartialEq for PatternNode
source§fn eq(&self, other: &PatternNode) -> bool
fn eq(&self, other: &PatternNode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PatternNode
impl StructuralPartialEq for PatternNode
Auto Trait Implementations§
impl RefUnwindSafe for PatternNode
impl Send for PatternNode
impl Sync for PatternNode
impl Unpin for PatternNode
impl UnwindSafe for PatternNode
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