[−][src]Enum swc_ecma_ast::Pat
Variants
Ident(Ident)
Array(ArrayPat)
Rest(RestPat)
Object(ObjectPat)
Assign(AssignPat)
Invalid(Invalid)
Only for for-in / for-of loops. This is syntatically valid.
Implementations
impl Pat
[src]
pub fn is_ident(&self) -> bool
[src]
Returns true
if self
is of variant Ident
.
pub fn expect_ident(self) -> Ident where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Ident
.
Panics
Panics if the value is not Ident
, with a panic message including the content of self
.
pub fn ident(self) -> Option<Ident>
[src]
Returns Some
if self
is of variant Ident
, and None
otherwise.
pub fn is_array(&self) -> bool
[src]
Returns true
if self
is of variant Array
.
pub fn expect_array(self) -> ArrayPat where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Array
.
Panics
Panics if the value is not Array
, with a panic message including the content of self
.
pub fn array(self) -> Option<ArrayPat>
[src]
Returns Some
if self
is of variant Array
, and None
otherwise.
pub fn is_rest(&self) -> bool
[src]
Returns true
if self
is of variant Rest
.
pub fn expect_rest(self) -> RestPat where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Rest
.
Panics
Panics if the value is not Rest
, with a panic message including the content of self
.
pub fn rest(self) -> Option<RestPat>
[src]
Returns Some
if self
is of variant Rest
, and None
otherwise.
pub fn is_object(&self) -> bool
[src]
Returns true
if self
is of variant Object
.
pub fn expect_object(self) -> ObjectPat where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Object
.
Panics
Panics if the value is not Object
, with a panic message including the content of self
.
pub fn object(self) -> Option<ObjectPat>
[src]
Returns Some
if self
is of variant Object
, and None
otherwise.
pub fn is_assign(&self) -> bool
[src]
Returns true
if self
is of variant Assign
.
pub fn expect_assign(self) -> AssignPat where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Assign
.
Panics
Panics if the value is not Assign
, with a panic message including the content of self
.
pub fn assign(self) -> Option<AssignPat>
[src]
Returns Some
if self
is of variant Assign
, and None
otherwise.
pub fn is_invalid(&self) -> bool
[src]
Returns true
if self
is of variant Invalid
.
pub fn expect_invalid(self) -> Invalid where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Invalid
.
Panics
Panics if the value is not Invalid
, with a panic message including the content of self
.
pub fn invalid(self) -> Option<Invalid>
[src]
Returns Some
if self
is of variant Invalid
, and None
otherwise.
pub fn is_expr(&self) -> bool
[src]
Returns true
if self
is of variant Expr
.
pub fn expect_expr(self) -> Box<Expr> where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Expr
.
Panics
Panics if the value is not Expr
, with a panic message including the content of self
.
pub fn expr(self) -> Option<Box<Expr>>
[src]
Returns Some
if self
is of variant Expr
, and None
otherwise.
Trait Implementations
impl Clone for Pat
[src]
impl Debug for Pat
[src]
impl<'de> Deserialize<'de> for Pat
[src]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Pat
[src]
impl From<ArrayPat> for Pat
[src]
impl From<AssignPat> for Pat
[src]
impl From<Box<Expr, Global>> for Pat
[src]
impl From<Ident> for Pat
[src]
impl From<Invalid> for Pat
[src]
impl From<ObjectPat> for Pat
[src]
impl From<Pat> for VarDeclOrPat
[src]
impl From<RestPat> for Pat
[src]
impl Hash for Pat
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Pat> for Pat
[src]
impl Serialize for Pat
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Spanned for Pat
[src]
impl StructuralEq for Pat
[src]
impl StructuralPartialEq for Pat
[src]
Auto Trait Implementations
impl RefUnwindSafe for Pat
impl Send for Pat
impl Sync for Pat
impl Unpin for Pat
impl UnwindSafe for Pat
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,