pub enum JsPrimitiveValue {
Undefined,
Null,
Boolean(bool),
Number(f64),
String(String),
BigInt(String),
Symbol(String),
}Expand description
Primitive JavaScript-like values for metadata and validation helpers.
Variants§
Implementations§
Source§impl JsPrimitiveValue
impl JsPrimitiveValue
Sourcepub fn is_truthy_like(&self) -> bool
pub fn is_truthy_like(&self) -> bool
Returns whether the value is approximately truthy by JavaScript primitive rules.
Sourcepub const fn is_nullish(&self) -> bool
pub const fn is_nullish(&self) -> bool
Returns whether the value is null or undefined.
Trait Implementations§
Source§impl Clone for JsPrimitiveValue
impl Clone for JsPrimitiveValue
Source§fn clone(&self) -> JsPrimitiveValue
fn clone(&self) -> JsPrimitiveValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 JsPrimitiveValue
impl Debug for JsPrimitiveValue
Source§impl PartialEq for JsPrimitiveValue
impl PartialEq for JsPrimitiveValue
Source§fn eq(&self, other: &JsPrimitiveValue) -> bool
fn eq(&self, other: &JsPrimitiveValue) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JsPrimitiveValue
Auto Trait Implementations§
impl Freeze for JsPrimitiveValue
impl RefUnwindSafe for JsPrimitiveValue
impl Send for JsPrimitiveValue
impl Sync for JsPrimitiveValue
impl Unpin for JsPrimitiveValue
impl UnsafeUnpin for JsPrimitiveValue
impl UnwindSafe for JsPrimitiveValue
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