[][src]Enum swc_ecma_ast::ModuleItem

pub enum ModuleItem {
    ModuleDecl(ModuleDecl),
    Stmt(Stmt),
}

Variants

ModuleDecl(ModuleDecl)
Stmt(Stmt)

Implementations

impl ModuleItem[src]

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

Returns true if self is of variant ModuleDecl.

pub fn expect_module_decl(self) -> ModuleDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of ModuleDecl.

Panics

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

pub fn module_decl(self) -> Option<ModuleDecl>[src]

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

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

Returns true if self is of variant Stmt.

pub fn expect_stmt(self) -> Stmt where
    Self: Debug
[src]

Unwraps the value, yielding the content of Stmt.

Panics

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

pub fn stmt(self) -> Option<Stmt>[src]

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

Trait Implementations

impl Clone for ModuleItem[src]

impl Debug for ModuleItem[src]

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

impl Eq for ModuleItem[src]

impl EqIgnoreSpan for ModuleItem[src]

impl From<ModuleDecl> for ModuleItem[src]

impl From<Stmt> for ModuleItem[src]

impl Hash for ModuleItem[src]

impl PartialEq<ModuleItem> for ModuleItem[src]

impl Serialize for ModuleItem[src]

impl Spanned for ModuleItem[src]

impl StructuralEq for ModuleItem[src]

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