pub enum ArrayPatternElement {
Elision,
SingleName {
ident: Identifier,
default_init: Option<Expression>,
},
PropertyAccess {
access: PropertyAccess,
default_init: Option<Expression>,
},
Pattern {
pattern: Pattern,
default_init: Option<Expression>,
},
SingleNameRest {
ident: Identifier,
},
PropertyAccessRest {
access: PropertyAccess,
},
PatternRest {
pattern: Pattern,
},
}Expand description
The different types of bindings that an array binding pattern may contain.
Corresponds to the BindingElement and the AssignmentElement nodes.
Variants§
Elision
Elision represents the elision of an item in the array binding pattern.
An Elision may occur at multiple points in the pattern and may be multiple elisions.
This variant strictly represents one elision. If there are multiple, this should be used multiple times.
More information:
SingleName
SingleName represents a SingleName with an identifier and an optional default initializer.
More information:
Fields
ident: IdentifierThe variable name where the index element will be stored.
default_init: Option<Expression>An optional default value for the variable, in case the index element doesn’t exist.
PropertyAccess
PropertyAccess represents a binding with a property accessor.
Note: According to the spec this is not part of an ArrayBindingPattern.
This is only used when a array literal is used as the left-hand-side of an assignment expression.
More information:
Fields
access: PropertyAccessThe property access where the index element will be stored.
default_init: Option<Expression>An optional default value for the variable, in case the index element doesn’t exist.
Pattern
Pattern represents a Pattern in an Element of an array pattern.
The pattern and the optional default initializer are both stored in the DeclarationPattern.
More information:
Fields
default_init: Option<Expression>An optional default value for the pattern, in case the index element doesn’t exist.
SingleNameRest
SingleNameRest represents a BindingIdentifier in a BindingRestElement of an array pattern.
More information:
Fields
ident: IdentifierThe variable where the unassigned index elements will be stored.
PropertyAccessRest
PropertyAccess represents a rest (spread operator) with a property accessor.
Note: According to the spec this is not part of an ArrayBindingPattern.
This is only used when a array literal is used as the left-hand-side of an assignment expression.
More information:
Fields
access: PropertyAccessThe property access where the unassigned index elements will be stored.
PatternRest
PatternRest represents a Pattern in a RestElement of an array pattern.
More information:
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for ArrayPatternElement
impl<'arbitrary> Arbitrary<'arbitrary> for ArrayPatternElement
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for ArrayPatternElement
impl Clone for ArrayPatternElement
Source§fn clone(&self) -> ArrayPatternElement
fn clone(&self) -> ArrayPatternElement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more