pub enum Value<'a> {
Null,
Bool(bool),
String(Cow<'a, str>),
Number(Number),
Array(Vec<Value<'a>>),
Object(Object<'a>),
}
Variants§
Implementations§
source§impl<'a> Value<'a>
impl<'a> Value<'a>
pub fn is_object(&self) -> bool
pub fn as_object(&self) -> Option<&Object<'a>>
pub fn is_array(&self) -> bool
pub fn as_array(&self) -> Option<&Vec<Value<'a>>>
pub fn is_string(&self) -> bool
pub fn as_str(&self) -> Option<&Cow<'_, str>>
pub fn is_number(&self) -> bool
pub fn as_number(&self) -> Option<&Number>
pub fn is_i64(&self) -> bool
pub fn is_u64(&self) -> bool
pub fn is_f64(&self) -> bool
pub fn as_i64(&self) -> Option<i64>
pub fn as_u64(&self) -> Option<u64>
pub fn as_f64(&self) -> Option<f64>
pub fn is_boolean(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn is_null(&self) -> bool
pub fn as_null(&self) -> Option<()>
sourcepub fn write_to_vec(&self, buf: &mut Vec<u8>)
pub fn write_to_vec(&self, buf: &mut Vec<u8>)
Serialize the JSONB Value into a byte stream.
pub fn get_by_name_ignore_case(&self, name: &str) -> Option<&Value<'a>>
pub fn array_length(&self) -> Option<usize>
pub fn object_keys(&self) -> Option<Value<'a>>
Trait Implementations§
source§impl<'a> From<OrderedFloat<f32>> for Value<'a>
impl<'a> From<OrderedFloat<f32>> for Value<'a>
source§fn from(f: OrderedFloat<f32>) -> Self
fn from(f: OrderedFloat<f32>) -> Self
Converts to this type from the input type.
source§impl<'a> From<OrderedFloat<f64>> for Value<'a>
impl<'a> From<OrderedFloat<f64>> for Value<'a>
source§fn from(f: OrderedFloat<f64>) -> Self
fn from(f: OrderedFloat<f64>) -> Self
Converts to this type from the input type.
source§impl<'a, T: Into<Value<'a>>> FromIterator<T> for Value<'a>
impl<'a, T: Into<Value<'a>>> FromIterator<T> for Value<'a>
source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
source§impl<'a> PartialEq for Value<'a>
impl<'a> PartialEq for Value<'a>
impl<'a> Eq for Value<'a>
impl<'a> StructuralEq for Value<'a>
impl<'a> StructuralPartialEq for Value<'a>
Auto Trait Implementations§
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> 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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.