[][src]Enum swc_ecma_ast::TsNamespaceBody

pub enum TsNamespaceBody {
    TsModuleBlock(TsModuleBlock),
    TsNamespaceDecl(TsNamespaceDecl),
}

namespace A.B { } is a namespace named A with another TsNamespaceDecl as its body.

Variants

TsModuleBlock(TsModuleBlock)
TsNamespaceDecl(TsNamespaceDecl)

Implementations

impl TsNamespaceBody[src]

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

Returns true if self is of variant TsModuleBlock.

pub fn expect_ts_module_block(self) -> TsModuleBlock where
    Self: Debug
[src]

Unwraps the value, yielding the content of TsModuleBlock.

Panics

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

pub fn ts_module_block(self) -> Option<TsModuleBlock>[src]

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

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

Returns true if self is of variant TsNamespaceDecl.

pub fn expect_ts_namespace_decl(self) -> TsNamespaceDecl where
    Self: Debug
[src]

Unwraps the value, yielding the content of TsNamespaceDecl.

Panics

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

pub fn ts_namespace_decl(self) -> Option<TsNamespaceDecl>[src]

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

Trait Implementations

impl Clone for TsNamespaceBody[src]

impl Debug for TsNamespaceBody[src]

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

impl Eq for TsNamespaceBody[src]

impl EqIgnoreSpan for TsNamespaceBody[src]

impl From<TsModuleBlock> for TsNamespaceBody[src]

impl From<TsNamespaceDecl> for TsNamespaceBody[src]

impl Hash for TsNamespaceBody[src]

impl PartialEq<TsNamespaceBody> for TsNamespaceBody[src]

impl Serialize for TsNamespaceBody[src]

impl Spanned for TsNamespaceBody[src]

impl StructuralEq for TsNamespaceBody[src]

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