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
Null
Bool(bool)
Number(Number)
String(String)
Array(Array)
Object(Object)
Trait Implementations
sourceimpl Deserialize for Value
impl Deserialize for Value
sourceimpl FromIterator<Value> for Array
impl FromIterator<Value> for Array
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Value>,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Value>,
Creates a value from an iterator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more