[−][src]Enum swc_ecma_ast::PropName
Variants
Ident(Ident)
Str(Str)
String literal.
Num(Number)
Numeric literal.
Computed(ComputedPropName)
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for PropName
[src]
impl From<BigInt> for PropName
[src]
impl From<ComputedPropName> for PropName
[src]
fn from(v: ComputedPropName) -> Self
[src]
impl From<Ident> for PropName
[src]
impl From<Number> for PropName
[src]
impl From<Str> for PropName
[src]
impl Hash for PropName
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<PropName> for PropName
[src]
impl Serialize for PropName
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Spanned for PropName
[src]
impl StructuralEq for PropName
[src]
impl StructuralPartialEq for PropName
[src]
Auto Trait Implementations
impl RefUnwindSafe for PropName
impl Send for PropName
impl Sync for PropName
impl Unpin for PropName
impl UnwindSafe for PropName
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,