pub struct Null;
Expand description
Null JSON type.
This is a dummy type that can only represent the null
JSON value.
Trait Implementations§
Source§impl Json for Null
impl Json for Null
Source§fn as_value_ref(&self) -> ValueRef<'_, Self>
fn as_value_ref(&self) -> ValueRef<'_, Self>
Returns a reference to the actual JSON value (without the metadata).
Source§fn as_value_mut(&mut self) -> ValueMut<'_, Self>
fn as_value_mut(&mut self) -> ValueMut<'_, Self>
Returns a mutable reference to the actual JSON value (without the metadata).
Source§fn into_parts(self) -> (Value<Self>, Self::MetaData)
fn into_parts(self) -> (Value<Self>, Self::MetaData)
Transforms this JSON value into a
Value
and MetaData
.Source§fn metadata(&self) -> &Self::MetaData
fn metadata(&self) -> &Self::MetaData
Returns a reference to the metadata associated to the JSON value.
Source§fn as_pair_mut(&mut self) -> (ValueMut<'_, Self>, &Self::MetaData)
fn as_pair_mut(&mut self) -> (ValueMut<'_, Self>, &Self::MetaData)
Returns a pair containing a mutable reference to the JSON value and a reference to its metadata.
Source§fn into_value(self) -> Value<Self>
fn into_value(self) -> Value<Self>
Transforms this JSON value into a
Value
.Source§fn as_pair(&self) -> (ValueRef<'_, Self>, &Self::MetaData)
fn as_pair(&self) -> (ValueRef<'_, Self>, &Self::MetaData)
Returns a pair containing a reference to the JSON value and a reference to its metadata.
Source§fn is_empty_array(&self) -> bool
fn is_empty_array(&self) -> bool
Checks if the value is an empty array.
Source§fn is_empty_object(&self) -> bool
fn is_empty_object(&self) -> bool
Checks if the value is an empty object.
Source§fn is_empty_array_or_object(&self) -> bool
fn is_empty_array_or_object(&self) -> bool
Checks if the value is an empty array or empty object.
Source§fn as_bool(&self) -> Option<bool>
fn as_bool(&self) -> Option<bool>
If the value is a boolean, returns the associated
bool
.
Returns None
otherwise.Source§fn as_number(&self) -> Option<&Self::Number>
fn as_number(&self) -> Option<&Self::Number>
If the value is a number, returns a reference to it.
Returns
None
otherwise.Source§fn as_u32(&self) -> Option<u32>
fn as_u32(&self) -> Option<u32>
Returns this number as an
u32
if it can be exactly represented as such.Source§fn as_u64(&self) -> Option<u64>
fn as_u64(&self) -> Option<u64>
Returns this number as an
u64
if it can be exactly represented as such.Source§fn as_i32(&self) -> Option<i32>
fn as_i32(&self) -> Option<i32>
Returns this number as an
i32
if it can be exactly represented as such.Source§fn as_i64(&self) -> Option<i64>
fn as_i64(&self) -> Option<i64>
Returns this number as an
i64
if it can be exactly represented as such.Source§fn as_f32(&self) -> Option<f32>
fn as_f32(&self) -> Option<f32>
Returns this number as an
f32
if it can be exactly represented as such.Source§fn as_f32_lossy(&self) -> Option<f32>
fn as_f32_lossy(&self) -> Option<f32>
Returns this number as an
f32
if it is a number, potentially losing precision in the process.Source§fn as_f64(&self) -> Option<f64>
fn as_f64(&self) -> Option<f64>
Returns this number as an
f64
if it can be exactly represented as such.Source§fn as_f64_lossy(&self) -> Option<f64>
fn as_f64_lossy(&self) -> Option<f64>
Returns this number as an
f64
if it is a number, potentially losing precision in the process.Source§fn as_str(&self) -> Option<&str>
fn as_str(&self) -> Option<&str>
If the value is a string, returns its associated
str
.
Returns None
otherwise.Source§fn as_array(&self) -> Option<&Self::Array>
fn as_array(&self) -> Option<&Self::Array>
If the value is an array, returns a reference to it.
Returns
None
otherwise.Source§fn as_array_mut(&mut self) -> Option<&mut Self::Array>
fn as_array_mut(&mut self) -> Option<&mut Self::Array>
If the value is an array, returns a mutable reference to it.
Returns
None
otherwise.Source§fn as_object(&self) -> Option<&Self::Object>
fn as_object(&self) -> Option<&Self::Object>
If the value is an object, returns a reference to it.
Returns
None
otherwise.Source§fn as_object_mut(&mut self) -> Option<&mut Self::Object>
fn as_object_mut(&mut self) -> Option<&mut Self::Object>
If the value is an object, returns a mutable reference to it.
Returns
None
otherwise.Source§impl Ord for Null
impl Ord for Null
Source§impl PartialOrd for Null
impl PartialOrd for Null
impl Eq for Null
impl StructuralPartialEq for Null
Auto Trait Implementations§
impl Freeze for Null
impl RefUnwindSafe for Null
impl Send for Null
impl Sync for Null
impl Unpin for Null
impl UnwindSafe for Null
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