pub enum Value<'i> {
Null,
Bool(bool),
String(Cow<'i, str>),
Number(f64),
Array(Vec<Value<'i>>),
Object(BTreeMap<Cow<'i, str>, Value<'i>>),
}Expand description
A JSON Value
This is the core type around which this crate is built. Anything that is de-serializable in a
json string can be represnted by a Value.
Variants§
Null
A null value: null
Bool(bool)
A boolean value: true`false`
String(Cow<'i, str>)
A string value: "a json \uD834\uDD1E string \t"
Implemented as a 🐮 such that strings without escape characters are borrowed directly from the input json string.
This isn’t a rust crate without a nod to something potentially being “zero-copy”.
Number(f64)
A numeric value: -0.5e1
Array(Vec<Value<'i>>)
An array of heterogeneous values: [1, null, "string"]
Object(BTreeMap<Cow<'i, str>, Value<'i>>)
A collection of key value pairs: { "prop": 3, "prop2": "val" }
Trait Implementations§
Auto Trait Implementations§
impl<'i> RefUnwindSafe for Value<'i>
impl<'i> Send for Value<'i>
impl<'i> Sync for Value<'i>
impl<'i> Unpin for Value<'i>
impl<'i> UnwindSafe for Value<'i>
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