pub enum Value {
Null,
Bool(bool),
Number(f64),
String(String),
Array(Vec<Value>),
Set(Vec<Value>),
Map(Vec<(String, Value)>),
}Expand description
A value that can be hashed.
This is the set of things the reference can hash, minus the ones that only
exist in JavaScript: there is no case for a function, a symbol, or a Date,
because a Rust caller would not pass one. A Map here stands for the
reference’s plain object and its Map, which it treats the same way.
Variants§
Null
The absence of a value. Written Null, not the empty string.
Bool(bool)
A boolean.
Number(f64)
A number. An integer is written as a float that happens to be integral, because the reference has no separate integer case.
String(String)
A string.
Array(Vec<Value>)
A sequence whose order matters.
Set(Vec<Value>)
A collection whose order does not matter.
Map(Vec<(String, Value)>)
A mapping from strings to values, written in key order.
Implementations§
Trait Implementations§
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 UnsafeUnpin 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