Enum stc_ts_types::Key
source · [−]pub enum Key {
Computed(ComputedKey),
Normal {
span: Span,
sym: JsWord,
},
Num(RNumber),
BigInt(RBigInt),
Private(PrivateName),
}
Variants
Computed(ComputedKey)
Normal
Num(RNumber)
BigInt(RBigInt)
Private(PrivateName)
Implementations
sourceimpl Key
impl Key
sourcepub fn is_computed(&self) -> bool
pub fn is_computed(&self) -> bool
Returns true
if self
is of variant Computed
.
sourcepub fn expect_computed(self) -> ComputedKeywhere
Self: Debug,
pub fn expect_computed(self) -> ComputedKeywhere
Self: Debug,
sourcepub fn computed(self) -> Option<ComputedKey>
pub fn computed(self) -> Option<ComputedKey>
Returns Some
if self
is of variant Computed
, and None
otherwise.
sourcepub fn expect_num(self) -> RNumberwhere
Self: Debug,
pub fn expect_num(self) -> RNumberwhere
Self: Debug,
sourcepub fn num(self) -> Option<RNumber>
pub fn num(self) -> Option<RNumber>
Returns Some
if self
is of variant Num
, and None
otherwise.
sourcepub fn is_big_int(&self) -> bool
pub fn is_big_int(&self) -> bool
Returns true
if self
is of variant BigInt
.
sourcepub fn expect_big_int(self) -> RBigIntwhere
Self: Debug,
pub fn expect_big_int(self) -> RBigIntwhere
Self: Debug,
sourcepub fn big_int(self) -> Option<RBigInt>
pub fn big_int(self) -> Option<RBigInt>
Returns Some
if self
is of variant BigInt
, and None
otherwise.
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns true
if self
is of variant Private
.
sourcepub fn expect_private(self) -> PrivateNamewhere
Self: Debug,
pub fn expect_private(self) -> PrivateNamewhere
Self: Debug,
sourcepub fn private(self) -> Option<PrivateName>
pub fn private(self) -> Option<PrivateName>
Returns Some
if self
is of variant Private
, and None
otherwise.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Key
impl<'de> Deserialize<'de> for Key
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for Key
impl EqIgnoreSpan for Key
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl Freeze for Key
impl Freeze for Key
sourcefn is_clone_cheap(&self) -> bool
fn is_clone_cheap(&self) -> bool
Returns
true
if `Clone::clone is cheap.sourcefn freeze(&mut self)
fn freeze(&mut self)
Make `Clone::clone cheap.
sourcefn freezed(self) -> Self
fn freezed(self) -> Self
Call
Self::freeze
and return self
.sourceimpl<V> VisitMutWith<V> for Keywhere
V: ?Sized,
impl<V> VisitMutWith<V> for Keywhere
V: ?Sized,
fn visit_mut_children_with(&mut self, _visitor: &mut V)
fn visit_mut_with(&mut self, visitor: &mut V)where
V: VisitMut<Self>,
sourceimpl<V> VisitWith<V> for Keywhere
V: ?Sized,
impl<V> VisitWith<V> for Keywhere
V: ?Sized,
fn visit_children_with(&self, _visitor: &mut V)
fn visit_with(&self, visitor: &mut V)where
V: Visit<Self>,
impl StructuralPartialEq for Key
impl Visitable for Key
Auto Trait Implementations
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations
sourceimpl<T> AssertCloneCheap for Twhere
T: Freeze,
impl<T> AssertCloneCheap for Twhere
T: Freeze,
sourcefn assert_clone_cheap(&self)
fn assert_clone_cheap(&self)
Assert that
self
is cheap to clone. This noop on production build.sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<R, N> IntoRNode<R> for Nwhere
R: RNode<Orig = N>,
impl<R, N> IntoRNode<R> for Nwhere
R: RNode<Orig = N>,
fn into_rnode(self, g: &mut NodeIdGenerator) -> R
sourceimpl<T> SpanExt for Twhere
T: Spanned,
impl<T> SpanExt for Twhere
T: Spanned,
fn is_synthesized(&self) -> bool
fn starts_on_new_line(&self, format: ListFormat) -> bool
sourcefn comment_range(&self) -> Span
fn comment_range(&self) -> Span
Gets a custom text range to use when emitting comments.