pub enum Value {
Null,
Bool(bool),
Number(Number),
String(String),
Array(Array),
Object(Object),
}
Expand description
Any valid JSON value.
This type has a non-recursive drop implementation so it is safe to build arbitrarily deeply nested instances.
use miniserde::json::{Array, Value};
let mut value = Value::Null;
for _ in 0..100000 {
let mut array = Array::new();
array.push(value);
value = Value::Array(array);
}
// no stack overflow when `value` goes out of scope
Variants§
Trait Implementations§
Source§impl Deserialize for Value
impl Deserialize for Value
Source§impl FromIterator<Value> for Array
impl FromIterator<Value> for Array
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