Enum swc_ecma_ast::PropName[][src]

pub enum PropName {
    Ident(Ident),
    Str(Str),
    Num(Number),
    Computed(ComputedPropName),
    BigInt(BigInt),
}

Variants

Ident(Ident)
Str(Str)

String literal.

Num(Number)

Numeric literal.

BigInt(BigInt)

Implementations

impl PropName[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.

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

Returns true if self is of variant Num.

pub fn expect_num(self) -> Number where
    Self: Debug
[src]

Unwraps the value, yielding the content of Num.

Panics

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

pub fn num(self) -> Option<Number>[src]

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

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

Returns true if self is of variant Computed.

pub fn expect_computed(self) -> ComputedPropName where
    Self: Debug
[src]

Unwraps the value, yielding the content of Computed.

Panics

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

pub fn computed(self) -> Option<ComputedPropName>[src]

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

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

Returns true if self is of variant BigInt.

pub fn expect_big_int(self) -> BigInt where
    Self: Debug
[src]

Unwraps the value, yielding the content of BigInt.

Panics

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

pub fn big_int(self) -> Option<BigInt>[src]

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

Trait Implementations

impl Clone for PropName[src]

impl Debug for PropName[src]

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

impl Eq for PropName[src]

impl EqIgnoreSpan for PropName[src]

impl From<BigInt> for PropName[src]

impl From<ComputedPropName> for PropName[src]

impl From<Ident> for PropName[src]

impl From<Number> for PropName[src]

impl From<Str> for PropName[src]

impl Hash for PropName[src]

impl PartialEq<PropName> for PropName[src]

impl Serialize for PropName[src]

impl Spanned for PropName[src]

impl StructuralEq for PropName[src]

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