[−][src]Enum swc_ecma_ast::TsLit
Variants
Number(Number)
Str(Str)
Bool(Bool)
Tpl(Tpl)
Implementations
impl TsLit
[src]
pub fn is_number(&self) -> bool
[src]
Returns true
if self
is of variant Number
.
pub fn expect_number(self) -> Number where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Number
.
Panics
Panics if the value is not Number
, with a panic message including the content of self
.
pub fn number(self) -> Option<Number>
[src]
Returns Some
if self
is of variant Number
, 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_bool(&self) -> bool
[src]
Returns true
if self
is of variant Bool
.
pub fn expect_bool(self) -> Bool where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Bool
.
Panics
Panics if the value is not Bool
, with a panic message including the content of self
.
pub fn bool(self) -> Option<Bool>
[src]
Returns Some
if self
is of variant Bool
, and None
otherwise.
pub fn is_tpl(&self) -> bool
[src]
Returns true
if self
is of variant Tpl
.
pub fn expect_tpl(self) -> Tpl where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Tpl
.
Panics
Panics if the value is not Tpl
, with a panic message including the content of self
.
pub fn tpl(self) -> Option<Tpl>
[src]
Returns Some
if self
is of variant Tpl
, and None
otherwise.
Trait Implementations
impl Clone for TsLit
[src]
impl Debug for TsLit
[src]
impl<'de> Deserialize<'de> for TsLit
[src]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for TsLit
[src]
impl From<Bool> for TsLit
[src]
impl From<Number> for TsLit
[src]
impl From<Str> for TsLit
[src]
impl From<Tpl> for TsLit
[src]
impl Hash for TsLit
[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<TsLit> for TsLit
[src]
impl Serialize for TsLit
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Spanned for TsLit
[src]
impl StructuralEq for TsLit
[src]
impl StructuralPartialEq for TsLit
[src]
Auto Trait Implementations
impl RefUnwindSafe for TsLit
impl Send for TsLit
impl Sync for TsLit
impl Unpin for TsLit
impl UnwindSafe for TsLit
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,