[][src]Enum swc_ecma_ast::ModuleDecl

pub enum ModuleDecl {
    Import(ImportDecl),
    ExportDecl(ExportDecl),
    ExportNamed(NamedExport),
    ExportDefaultDecl(ExportDefaultDecl),
    ExportDefaultExpr(ExportDefaultExpr),
    ExportAll(ExportAll),
    TsImportEquals(TsImportEqualsDecl),
    TsExportAssignment(TsExportAssignment),
    TsNamespaceExport(TsNamespaceExportDecl),
}

Variants

Import(ImportDecl)
ExportDecl(ExportDecl)
ExportNamed(NamedExport)
ExportDefaultDecl(ExportDefaultDecl)
ExportDefaultExpr(ExportDefaultExpr)
ExportAll(ExportAll)
TsImportEquals(TsImportEqualsDecl)
TsExportAssignment(TsExportAssignment)
TsNamespaceExport(TsNamespaceExportDecl)

Implementations

impl ModuleDecl[src]

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

Returns true if self is of variant Import.

pub fn expect_import(self) -> ImportDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of Import.

Panics

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

pub fn import(self) -> Option<ImportDecl>[src]

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

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

Returns true if self is of variant ExportDecl.

pub fn expect_export_decl(self) -> ExportDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of ExportDecl.

Panics

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

pub fn export_decl(self) -> Option<ExportDecl>[src]

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

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

Returns true if self is of variant ExportNamed.

pub fn expect_export_named(self) -> NamedExport where
    Self: Debug
[src]

Unwraps the value, yielding the content of ExportNamed.

Panics

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

pub fn export_named(self) -> Option<NamedExport>[src]

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

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

Returns true if self is of variant ExportDefaultDecl.

pub fn expect_export_default_decl(self) -> ExportDefaultDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of ExportDefaultDecl.

Panics

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

pub fn export_default_decl(self) -> Option<ExportDefaultDecl>[src]

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

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

Returns true if self is of variant ExportDefaultExpr.

pub fn expect_export_default_expr(self) -> ExportDefaultExpr where
    Self: Debug
[src]

Unwraps the value, yielding the content of ExportDefaultExpr.

Panics

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

pub fn export_default_expr(self) -> Option<ExportDefaultExpr>[src]

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

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

Returns true if self is of variant ExportAll.

pub fn expect_export_all(self) -> ExportAll where
    Self: Debug
[src]

Unwraps the value, yielding the content of ExportAll.

Panics

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

pub fn export_all(self) -> Option<ExportAll>[src]

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

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

Returns true if self is of variant TsImportEquals.

pub fn expect_ts_import_equals(self) -> TsImportEqualsDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of TsImportEquals.

Panics

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

pub fn ts_import_equals(self) -> Option<TsImportEqualsDecl>[src]

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

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

Returns true if self is of variant TsExportAssignment.

pub fn expect_ts_export_assignment(self) -> TsExportAssignment where
    Self: Debug
[src]

Unwraps the value, yielding the content of TsExportAssignment.

Panics

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

pub fn ts_export_assignment(self) -> Option<TsExportAssignment>[src]

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

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

Returns true if self is of variant TsNamespaceExport.

pub fn expect_ts_namespace_export(self) -> TsNamespaceExportDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of TsNamespaceExport.

Panics

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

pub fn ts_namespace_export(self) -> Option<TsNamespaceExportDecl>[src]

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

Trait Implementations

impl Clone for ModuleDecl[src]

impl Debug for ModuleDecl[src]

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

impl Eq for ModuleDecl[src]

impl EqIgnoreSpan for ModuleDecl[src]

impl From<ExportAll> for ModuleDecl[src]

impl From<ExportDecl> for ModuleDecl[src]

impl From<ExportDefaultDecl> for ModuleDecl[src]

impl From<ExportDefaultExpr> for ModuleDecl[src]

impl From<ImportDecl> for ModuleDecl[src]

impl From<ModuleDecl> for ModuleItem[src]

impl From<NamedExport> for ModuleDecl[src]

impl From<TsExportAssignment> for ModuleDecl[src]

impl From<TsImportEqualsDecl> for ModuleDecl[src]

impl From<TsNamespaceExportDecl> for ModuleDecl[src]

impl Hash for ModuleDecl[src]

impl PartialEq<ModuleDecl> for ModuleDecl[src]

impl Serialize for ModuleDecl[src]

impl Spanned for ModuleDecl[src]

impl StructuralEq for ModuleDecl[src]

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