Enum swc_ecma_ast::TsFnParam[][src]

pub enum TsFnParam {
    Ident(BindingIdent),
    Array(ArrayPat),
    Rest(RestPat),
    Object(ObjectPat),
}

Variants

Array(ArrayPat)
Rest(RestPat)
Object(ObjectPat)

Implementations

impl TsFnParam[src]

pub fn is_ident(&self) -> bool[src]

Returns true if self is of variant Ident.

pub fn expect_ident(self) -> BindingIdent where
    Self: Debug
[src]

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<BindingIdent>[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]

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]

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]

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.

Trait Implementations

impl Clone for TsFnParam[src]

impl Debug for TsFnParam[src]

impl<'de> Deserialize<'de> for TsFnParam[src]

impl Eq for TsFnParam[src]

impl EqIgnoreSpan for TsFnParam[src]

impl From<ArrayPat> for TsFnParam[src]

impl From<BindingIdent> for TsFnParam[src]

impl From<ObjectPat> for TsFnParam[src]

impl From<RestPat> for TsFnParam[src]

impl Hash for TsFnParam[src]

impl PartialEq<TsFnParam> for TsFnParam[src]

impl Serialize for TsFnParam[src]

impl Spanned for TsFnParam[src]

impl StructuralEq for TsFnParam[src]

impl StructuralPartialEq for TsFnParam[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.