Enum swc_ecma_ast::TsNamespaceBody
source · [−]pub enum TsNamespaceBody {
TsModuleBlock(TsModuleBlock),
TsNamespaceDecl(TsNamespaceDecl),
}
Expand description
namespace A.B { }
is a namespace named A
with another TsNamespaceDecl as
its body.
Variants
TsModuleBlock(TsModuleBlock)
TsNamespaceDecl(TsNamespaceDecl)
Implementations
sourceimpl TsNamespaceBody
impl TsNamespaceBody
sourcepub fn is_ts_module_block(&self) -> bool
pub fn is_ts_module_block(&self) -> bool
Returns true
if self
is of variant TsModuleBlock
.
sourcepub fn as_ts_module_block(&self) -> Option<&TsModuleBlock>
pub fn as_ts_module_block(&self) -> Option<&TsModuleBlock>
Returns Some
if self
is a reference of variant TsModuleBlock
, and None
otherwise.
sourcepub fn as_mut_ts_module_block(&mut self) -> Option<&mut TsModuleBlock>
pub fn as_mut_ts_module_block(&mut self) -> Option<&mut TsModuleBlock>
Returns Some
if self
is a mutable reference of variant TsModuleBlock
, and None
otherwise.
sourcepub fn expect_ts_module_block(self) -> TsModuleBlockwhere
Self: Debug,
pub fn expect_ts_module_block(self) -> TsModuleBlockwhere
Self: Debug,
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
.
sourcepub fn ts_module_block(self) -> Option<TsModuleBlock>
pub fn ts_module_block(self) -> Option<TsModuleBlock>
Returns Some
if self
is of variant TsModuleBlock
, and None
otherwise.
sourcepub fn is_ts_namespace_decl(&self) -> bool
pub fn is_ts_namespace_decl(&self) -> bool
Returns true
if self
is of variant TsNamespaceDecl
.
sourcepub fn as_ts_namespace_decl(&self) -> Option<&TsNamespaceDecl>
pub fn as_ts_namespace_decl(&self) -> Option<&TsNamespaceDecl>
Returns Some
if self
is a reference of variant TsNamespaceDecl
, and None
otherwise.
sourcepub fn as_mut_ts_namespace_decl(&mut self) -> Option<&mut TsNamespaceDecl>
pub fn as_mut_ts_namespace_decl(&mut self) -> Option<&mut TsNamespaceDecl>
Returns Some
if self
is a mutable reference of variant TsNamespaceDecl
, and None
otherwise.
sourcepub fn expect_ts_namespace_decl(self) -> TsNamespaceDeclwhere
Self: Debug,
pub fn expect_ts_namespace_decl(self) -> TsNamespaceDeclwhere
Self: Debug,
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
.
sourcepub fn ts_namespace_decl(self) -> Option<TsNamespaceDecl>
pub fn ts_namespace_decl(self) -> Option<TsNamespaceDecl>
Returns Some
if self
is of variant TsNamespaceDecl
, and None
otherwise.
Trait Implementations
sourceimpl Clone for TsNamespaceBody
impl Clone for TsNamespaceBody
sourcefn clone(&self) -> TsNamespaceBody
fn clone(&self) -> TsNamespaceBody
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more