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§
source§impl TsNamespaceBody
impl TsNamespaceBody
sourcepub const fn is_ts_module_block(&self) -> bool
pub const 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 const fn is_ts_namespace_decl(&self) -> bool
pub const 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§
source§impl<'arbitrary> Arbitrary<'arbitrary> for TsNamespaceBody
impl<'arbitrary> Arbitrary<'arbitrary> for TsNamespaceBody
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moresource§impl Archive for TsNamespaceBody
impl Archive for TsNamespaceBody
source§impl Clone for TsNamespaceBody
impl Clone for TsNamespaceBody
source§fn clone(&self) -> TsNamespaceBody
fn clone(&self) -> TsNamespaceBody
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TsNamespaceBody
impl Debug for TsNamespaceBody
source§impl<'de> Deserialize<'de> for TsNamespaceBody
impl<'de> Deserialize<'de> for TsNamespaceBody
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl<__D> Deserialize<TsNamespaceBody, __D> for Archived<TsNamespaceBody>where
__D: SharedDeserializeRegistry + Fallible + ?Sized,
impl<__D> Deserialize<TsNamespaceBody, __D> for Archived<TsNamespaceBody>where __D: SharedDeserializeRegistry + Fallible + ?Sized,
source§fn deserialize(
&self,
deserializer: &mut __D
) -> Result<TsNamespaceBody, __D::Error>
fn deserialize( &self, deserializer: &mut __D ) -> Result<TsNamespaceBody, __D::Error>
source§impl EqIgnoreSpan for TsNamespaceBody
impl EqIgnoreSpan for TsNamespaceBody
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<TsModuleBlock> for TsNamespaceBody
impl From<TsModuleBlock> for TsNamespaceBody
source§fn from(v: TsModuleBlock) -> Self
fn from(v: TsModuleBlock) -> Self
source§impl From<TsNamespaceDecl> for TsNamespaceBody
impl From<TsNamespaceDecl> for TsNamespaceBody
source§fn from(v: TsNamespaceDecl) -> Self
fn from(v: TsNamespaceDecl) -> Self
source§impl Hash for TsNamespaceBody
impl Hash for TsNamespaceBody
source§impl PartialEq for TsNamespaceBody
impl PartialEq for TsNamespaceBody
source§fn eq(&self, other: &TsNamespaceBody) -> bool
fn eq(&self, other: &TsNamespaceBody) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<__S> Serialize<__S> for TsNamespaceBodywhere
__S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
impl<__S> Serialize<__S> for TsNamespaceBodywhere __S: Serializer + ScratchSpace + SharedSerializeRegistry + Fallible + ?Sized,
source§impl Serialize for TsNamespaceBody
impl Serialize for TsNamespaceBody
source§impl Spanned for TsNamespaceBody
impl Spanned for TsNamespaceBody
impl Eq for TsNamespaceBody
impl StructuralEq for TsNamespaceBody
impl StructuralPartialEq for TsNamespaceBody
Auto Trait Implementations§
impl RefUnwindSafe for TsNamespaceBody
impl Send for TsNamespaceBody
impl Sync for TsNamespaceBody
impl Unpin for TsNamespaceBody
impl UnwindSafe for TsNamespaceBody
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read more