[][src]Enum swc_ecma_ast::ImportSpecifier

pub enum ImportSpecifier {
    Named(ImportNamedSpecifier),
    Default(ImportDefaultSpecifier),
    Namespace(ImportStarAsSpecifier),
}

Variants

Implementations

impl ImportSpecifier[src]

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

Returns true if self is of variant Named.

pub fn expect_named(self) -> ImportNamedSpecifier where
    Self: Debug
[src]

Unwraps the value, yielding the content of Named.

Panics

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

pub fn named(self) -> Option<ImportNamedSpecifier>[src]

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

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

Returns true if self is of variant Default.

pub fn expect_default(self) -> ImportDefaultSpecifier where
    Self: Debug
[src]

Unwraps the value, yielding the content of Default.

Panics

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

pub fn default(self) -> Option<ImportDefaultSpecifier>[src]

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

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

Returns true if self is of variant Namespace.

pub fn expect_namespace(self) -> ImportStarAsSpecifier where
    Self: Debug
[src]

Unwraps the value, yielding the content of Namespace.

Panics

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

pub fn namespace(self) -> Option<ImportStarAsSpecifier>[src]

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

Trait Implementations

impl Clone for ImportSpecifier[src]

impl Debug for ImportSpecifier[src]

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

impl Eq for ImportSpecifier[src]

impl EqIgnoreSpan for ImportSpecifier[src]

impl From<ImportDefaultSpecifier> for ImportSpecifier[src]

impl From<ImportNamedSpecifier> for ImportSpecifier[src]

impl From<ImportStarAsSpecifier> for ImportSpecifier[src]

impl Hash for ImportSpecifier[src]

impl PartialEq<ImportSpecifier> for ImportSpecifier[src]

impl Serialize for ImportSpecifier[src]

impl Spanned for ImportSpecifier[src]

impl StructuralEq for ImportSpecifier[src]

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