pub enum Value {
Number(f64),
String(String),
Boolean(bool),
Object(ObjectHandle),
Array(ArrayHandle),
Function(FunctionHandle),
Null,
Undefined,
}Variants§
Number(f64)
String(String)
Boolean(bool)
Object(ObjectHandle)
Array(ArrayHandle)
Function(FunctionHandle)
Null
Undefined
Implementations§
Source§impl Value
impl Value
pub fn is_primitive(&self) -> bool
pub fn as_number(&self) -> Option<f64>
pub fn as_bool(&self) -> Option<bool>
pub fn as_string(&self) -> Option<&str>
pub fn to_number(&self) -> f64
pub fn to_string_value(&self) -> String
pub fn to_boolean(&self) -> bool
pub fn is_truthy(&self) -> bool
pub fn is_falsy(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn 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
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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