pub enum Value<'a> {
Null,
Bool(bool),
Int64(i64),
Uint64(u64),
Double(f64),
String(&'a str),
Array(Vec<Value<'a>>),
Object(Vec<(&'a str, Value<'a>)>),
}Expand description
A zero-copy representation of a JSON value parsed from the simdjson tape.
Variants§
Null
Bool(bool)
Int64(i64)
Uint64(u64)
Double(f64)
String(&'a str)
Array(Vec<Value<'a>>)
Object(Vec<(&'a str, Value<'a>)>)
Implementations§
Source§impl<'a> Value<'a>
impl<'a> Value<'a>
Sourcepub fn get_index(&self, index: usize) -> Option<&Value<'a>>
pub fn get_index(&self, index: usize) -> Option<&Value<'a>>
Look up an element in a JSON array by index.
Sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
Returns the i64 value if this is an Int64 or a compatible Uint64.
Sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
Returns the u64 value if this is a Uint64 or a compatible Int64.
Trait Implementations§
impl<'a> StructuralPartialEq for Value<'a>
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnsafeUnpin for Value<'a>
impl<'a> UnwindSafe for Value<'a>
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