Enum swc_ecma_ast::ImportSpecifier
source · [−]pub enum ImportSpecifier {
Named(ImportNamedSpecifier),
Default(ImportDefaultSpecifier),
Namespace(ImportStarAsSpecifier),
}
Variants
Named(ImportNamedSpecifier)
Default(ImportDefaultSpecifier)
Namespace(ImportStarAsSpecifier)
Implementations
sourceimpl 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 fn is_default(&self) -> bool
pub 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 fn is_namespace(&self) -> bool
pub 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
sourceimpl Clone for ImportSpecifier
impl Clone for ImportSpecifier
sourcefn clone(&self) -> ImportSpecifier
fn clone(&self) -> ImportSpecifier
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more