Enum swc_ecma_ast::TsEnumMemberId[][src]

pub enum TsEnumMemberId {
    Ident(Ident),
    Str(Str),
}
  • Invalid: Ident with empty symbol.

Variants

Ident(Ident)
Str(Str)

Implementations

impl TsEnumMemberId[src]

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

Returns true if self is of variant Ident.

pub fn expect_ident(self) -> Ident where
    Self: Debug
[src]

Unwraps the value, yielding the content of Ident.

Panics

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

pub fn ident(self) -> Option<Ident>[src]

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

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

Returns true if self is of variant Str.

pub fn expect_str(self) -> Str where
    Self: Debug
[src]

Unwraps the value, yielding the content of Str.

Panics

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

pub fn str(self) -> Option<Str>[src]

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

Trait Implementations

impl Clone for TsEnumMemberId[src]

impl Debug for TsEnumMemberId[src]

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

impl Eq for TsEnumMemberId[src]

impl EqIgnoreSpan for TsEnumMemberId[src]

impl From<Ident> for TsEnumMemberId[src]

impl From<Str> for TsEnumMemberId[src]

impl Hash for TsEnumMemberId[src]

impl PartialEq<TsEnumMemberId> for TsEnumMemberId[src]

impl Serialize for TsEnumMemberId[src]

impl Spanned for TsEnumMemberId[src]

impl StructuralEq for TsEnumMemberId[src]

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