pub enum TypeofKind {
String,
Number,
Boolean,
BigInt,
Symbol,
Undefined,
Object,
Function,
}Expand description
The result of a typeof expression, restricted to the 8 standard JavaScript types.
Using an enum instead of String eliminates heap allocation per typeof guard.
TypeScript’s typeof operator only returns these 8 values.
Variants§
Implementations§
Trait Implementations§
Source§impl Clone for TypeofKind
impl Clone for TypeofKind
Source§fn clone(&self) -> TypeofKind
fn clone(&self) -> TypeofKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeofKind
impl Debug for TypeofKind
Source§impl Hash for TypeofKind
impl Hash for TypeofKind
Source§impl PartialEq for TypeofKind
impl PartialEq for TypeofKind
impl Copy for TypeofKind
impl Eq for TypeofKind
impl StructuralPartialEq for TypeofKind
Auto Trait Implementations§
impl Freeze for TypeofKind
impl RefUnwindSafe for TypeofKind
impl Send for TypeofKind
impl Sync for TypeofKind
impl Unpin for TypeofKind
impl UnsafeUnpin for TypeofKind
impl UnwindSafe for TypeofKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.