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 Clone for ArrayPatternElement
impl Clone for ArrayPatternElement
Source§fn clone(&self) -> ArrayPatternElement
fn clone(&self) -> ArrayPatternElement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArrayPatternElement
impl Debug for ArrayPatternElement
Source§impl<'de> Deserialize<'de> for ArrayPatternElement
impl<'de> Deserialize<'de> for ArrayPatternElement
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArrayPatternElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArrayPatternElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<'a> From<&'a ArrayPatternElement> for NodeRef<'a>
impl<'a> From<&'a ArrayPatternElement> for NodeRef<'a>
Source§fn from(node: &'a ArrayPatternElement) -> NodeRef<'a>
fn from(node: &'a ArrayPatternElement) -> NodeRef<'a>
Source§impl<'a> From<&'a mut ArrayPatternElement> for NodeRefMut<'a>
impl<'a> From<&'a mut ArrayPatternElement> for NodeRefMut<'a>
Source§fn from(node: &'a mut ArrayPatternElement) -> NodeRefMut<'a>
fn from(node: &'a mut ArrayPatternElement) -> NodeRefMut<'a>
Source§impl PartialEq for ArrayPatternElement
impl PartialEq for ArrayPatternElement
Source§impl Serialize for ArrayPatternElement
impl Serialize for ArrayPatternElement
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToInternedString for ArrayPatternElement
impl ToInternedString for ArrayPatternElement
Source§fn to_interned_string(&self, interner: &Interner) -> String
fn to_interned_string(&self, interner: &Interner) -> String
Source§impl VisitWith for ArrayPatternElement
impl VisitWith for ArrayPatternElement
Source§fn visit_with<'a, V>(
&'a self,
visitor: &mut V,
) -> ControlFlow<<V as Visitor<'a>>::BreakTy>where
V: Visitor<'a>,
fn visit_with<'a, V>(
&'a self,
visitor: &mut V,
) -> ControlFlow<<V as Visitor<'a>>::BreakTy>where
V: Visitor<'a>,
Source§fn visit_with_mut<'a, V>(
&'a mut self,
visitor: &mut V,
) -> ControlFlow<<V as VisitorMut<'a>>::BreakTy>where
V: VisitorMut<'a>,
fn visit_with_mut<'a, V>(
&'a mut self,
visitor: &mut V,
) -> ControlFlow<<V as VisitorMut<'a>>::BreakTy>where
V: VisitorMut<'a>,
impl StructuralPartialEq for ArrayPatternElement
Auto Trait Implementations§
impl Freeze for ArrayPatternElement
impl !RefUnwindSafe for ArrayPatternElement
impl !Send for ArrayPatternElement
impl !Sync for ArrayPatternElement
impl Unpin for ArrayPatternElement
impl !UnwindSafe for ArrayPatternElement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.