Enum swc_ecma_ast::ImportSpecifier
source · pub enum ImportSpecifier {
Named(ImportNamedSpecifier),
Default(ImportDefaultSpecifier),
Namespace(ImportStarAsSpecifier),
}
Variants§
Implementations§
source§impl ImportSpecifier
impl ImportSpecifier
sourcepub fn as_named(&self) -> Option<&ImportNamedSpecifier>
pub fn as_named(&self) -> Option<&ImportNamedSpecifier>
Returns Some
if self
is a reference of variant Named
, and None
otherwise.
sourcepub fn as_mut_named(&mut self) -> Option<&mut ImportNamedSpecifier>
pub fn as_mut_named(&mut self) -> Option<&mut ImportNamedSpecifier>
Returns Some
if self
is a mutable reference of variant Named
, and None
otherwise.
sourcepub fn expect_named(self) -> ImportNamedSpecifierwhere
Self: Debug,
pub fn expect_named(self) -> ImportNamedSpecifierwhere
Self: Debug,
sourcepub fn named(self) -> Option<ImportNamedSpecifier>
pub fn named(self) -> Option<ImportNamedSpecifier>
Returns Some
if self
is of variant Named
, and None
otherwise.
sourcepub const fn is_default(&self) -> bool
pub const fn is_default(&self) -> bool
Returns true
if self
is of variant Default
.
sourcepub fn as_default(&self) -> Option<&ImportDefaultSpecifier>
pub fn as_default(&self) -> Option<&ImportDefaultSpecifier>
Returns Some
if self
is a reference of variant Default
, and None
otherwise.
sourcepub fn as_mut_default(&mut self) -> Option<&mut ImportDefaultSpecifier>
pub fn as_mut_default(&mut self) -> Option<&mut ImportDefaultSpecifier>
Returns Some
if self
is a mutable reference of variant Default
, and None
otherwise.
sourcepub fn expect_default(self) -> ImportDefaultSpecifierwhere
Self: Debug,
pub fn expect_default(self) -> ImportDefaultSpecifierwhere
Self: Debug,
sourcepub fn default(self) -> Option<ImportDefaultSpecifier>
pub fn default(self) -> Option<ImportDefaultSpecifier>
Returns Some
if self
is of variant Default
, and None
otherwise.
sourcepub const fn is_namespace(&self) -> bool
pub const fn is_namespace(&self) -> bool
Returns true
if self
is of variant Namespace
.
sourcepub fn as_namespace(&self) -> Option<&ImportStarAsSpecifier>
pub fn as_namespace(&self) -> Option<&ImportStarAsSpecifier>
Returns Some
if self
is a reference of variant Namespace
, and None
otherwise.
sourcepub fn as_mut_namespace(&mut self) -> Option<&mut ImportStarAsSpecifier>
pub fn as_mut_namespace(&mut self) -> Option<&mut ImportStarAsSpecifier>
Returns Some
if self
is a mutable reference of variant Namespace
, and None
otherwise.
sourcepub fn expect_namespace(self) -> ImportStarAsSpecifierwhere
Self: Debug,
pub fn expect_namespace(self) -> ImportStarAsSpecifierwhere
Self: Debug,
sourcepub fn namespace(self) -> Option<ImportStarAsSpecifier>
pub fn namespace(self) -> Option<ImportStarAsSpecifier>
Returns Some
if self
is of variant Namespace
, and None
otherwise.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for ImportSpecifier
impl<'arbitrary> Arbitrary<'arbitrary> for ImportSpecifier
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 ImportSpecifier
impl Archive for ImportSpecifier
source§impl Clone for ImportSpecifier
impl Clone for ImportSpecifier
source§fn clone(&self) -> ImportSpecifier
fn clone(&self) -> ImportSpecifier
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ImportSpecifier
impl Debug for ImportSpecifier
source§impl<'de> Deserialize<'de> for ImportSpecifier
impl<'de> Deserialize<'de> for ImportSpecifier
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<ImportSpecifier, __D> for Archived<ImportSpecifier>
impl<__D> Deserialize<ImportSpecifier, __D> for Archived<ImportSpecifier>
source§fn deserialize(
&self,
deserializer: &mut __D
) -> Result<ImportSpecifier, __D::Error>
fn deserialize( &self, deserializer: &mut __D ) -> Result<ImportSpecifier, __D::Error>
source§impl EqIgnoreSpan for ImportSpecifier
impl EqIgnoreSpan for ImportSpecifier
fn eq_ignore_span(&self, other: &Self) -> bool
source§impl From<ImportDefaultSpecifier> for ImportSpecifier
impl From<ImportDefaultSpecifier> for ImportSpecifier
source§fn from(v: ImportDefaultSpecifier) -> Self
fn from(v: ImportDefaultSpecifier) -> Self
source§impl From<ImportNamedSpecifier> for ImportSpecifier
impl From<ImportNamedSpecifier> for ImportSpecifier
source§fn from(v: ImportNamedSpecifier) -> Self
fn from(v: ImportNamedSpecifier) -> Self
source§impl From<ImportStarAsSpecifier> for ImportSpecifier
impl From<ImportStarAsSpecifier> for ImportSpecifier
source§fn from(v: ImportStarAsSpecifier) -> Self
fn from(v: ImportStarAsSpecifier) -> Self
source§impl Hash for ImportSpecifier
impl Hash for ImportSpecifier
source§impl PartialEq for ImportSpecifier
impl PartialEq for ImportSpecifier
source§fn eq(&self, other: &ImportSpecifier) -> bool
fn eq(&self, other: &ImportSpecifier) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<__S> Serialize<__S> for ImportSpecifier
impl<__S> Serialize<__S> for ImportSpecifier
source§impl Serialize for ImportSpecifier
impl Serialize for ImportSpecifier
source§impl Spanned for ImportSpecifier
impl Spanned for ImportSpecifier
impl Eq for ImportSpecifier
impl StructuralEq for ImportSpecifier
impl StructuralPartialEq for ImportSpecifier
Auto Trait Implementations§
impl RefUnwindSafe for ImportSpecifier
impl Send for ImportSpecifier
impl Sync for ImportSpecifier
impl Unpin for ImportSpecifier
impl UnwindSafe for ImportSpecifier
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