Struct valkyrie_ast::ArrayPatternNode
source · pub struct ArrayPatternNode {
pub bind: Option<IdentifierNode>,
pub terms: Vec<PatternNode>,
pub span: Range<u32>,
}
Expand description
bind <- [a, b, **]
match term {
case bind@module::Name[ref a, mut b, c] if a > 0:
body()
}
let bind = term;
# Option<(?, ?, ?)>
let unapply = module::Name::extract(bind);
if unapply.is_none() {
break;
}
# (?, ?, ?)
let bind = unapply!;
let a = unapply!.0;
let b = unapply!.1;
let c = unapply!.2;
Fields§
§bind: Option<IdentifierNode>
bind <- ...
terms: Vec<PatternNode>
[a, b, **]
span: Range<u32>
The range of the node
Trait Implementations§
source§impl Clone for ArrayPatternNode
impl Clone for ArrayPatternNode
source§fn clone(&self) -> ArrayPatternNode
fn clone(&self) -> ArrayPatternNode
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 ArrayPatternNode
impl Debug for ArrayPatternNode
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 Hash for ArrayPatternNode
impl Hash for ArrayPatternNode
source§impl PartialEq for ArrayPatternNode
impl PartialEq for ArrayPatternNode
source§fn eq(&self, other: &ArrayPatternNode) -> bool
fn eq(&self, other: &ArrayPatternNode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ArrayPatternNode
impl StructuralPartialEq for ArrayPatternNode
Auto Trait Implementations§
impl RefUnwindSafe for ArrayPatternNode
impl Send for ArrayPatternNode
impl Sync for ArrayPatternNode
impl Unpin for ArrayPatternNode
impl UnwindSafe for ArrayPatternNode
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