Enum swc_ecma_ast::DefaultDecl[][src]

pub enum DefaultDecl {
    Class(ClassExpr),
    Fn(FnExpr),
    TsInterfaceDecl(TsInterfaceDecl),
}

Variants

Class(ClassExpr)
Fn(FnExpr)
TsInterfaceDecl(TsInterfaceDecl)

Implementations

impl DefaultDecl[src]

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

Returns true if self is of variant Class.

pub fn expect_class(self) -> ClassExpr where
    Self: Debug
[src]

Unwraps the value, yielding the content of Class.

Panics

Panics if the value is not Class, with a panic message including the content of self.

pub fn class(self) -> Option<ClassExpr>[src]

Returns Some if self is of variant Class, and None otherwise.

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

Returns true if self is of variant Fn.

pub fn expect_fn_expr(self) -> FnExpr where
    Self: Debug
[src]

Unwraps the value, yielding the content of Fn.

Panics

Panics if the value is not Fn, with a panic message including the content of self.

pub fn fn_expr(self) -> Option<FnExpr>[src]

Returns Some if self is of variant Fn, and None otherwise.

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

Returns true if self is of variant TsInterfaceDecl.

pub fn expect_ts_interface_decl(self) -> TsInterfaceDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of TsInterfaceDecl.

Panics

Panics if the value is not TsInterfaceDecl, with a panic message including the content of self.

pub fn ts_interface_decl(self) -> Option<TsInterfaceDecl>[src]

Returns Some if self is of variant TsInterfaceDecl, and None otherwise.

Trait Implementations

impl Clone for DefaultDecl[src]

impl Debug for DefaultDecl[src]

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

impl Eq for DefaultDecl[src]

impl EqIgnoreSpan for DefaultDecl[src]

impl From<ClassExpr> for DefaultDecl[src]

impl From<FnExpr> for DefaultDecl[src]

impl From<TsInterfaceDecl> for DefaultDecl[src]

impl Hash for DefaultDecl[src]

impl PartialEq<DefaultDecl> for DefaultDecl[src]

impl Serialize for DefaultDecl[src]

impl Spanned for DefaultDecl[src]

impl StructuralEq for DefaultDecl[src]

impl StructuralPartialEq for DefaultDecl[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.