Struct Null

Source
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 Debug for Null

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Null

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Json for Null

Source§

type Array = Vec<Null>

Array type.

Source§

type Key = String

Object key type.

Source§

type Object = BTreeMap<String, Null>

Object type.

Source§

type MetaData = ()

Metadata type attached to each value. Read more
Source§

type Number = Zero

Literal number type.
Source§

type String = String

String type.
Source§

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>

Returns a mutable reference to the actual JSON value (without the metadata).
Source§

fn into_parts(self) -> (Value<Self>, Self::MetaData)

Transforms this JSON value into a Value and MetaData.
Source§

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)

Returns a pair containing a mutable reference to the JSON value and a reference to its metadata.
Source§

fn into_value(self) -> Value<Self>

Transforms this JSON value into a Value.
Source§

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_null(&self) -> bool

Returns true if the value is a Null. Returns false otherwise.
Source§

fn is_empty_array(&self) -> bool

Checks if the value is an empty array.
Source§

fn is_empty_object(&self) -> bool

Checks if the value is an empty object.
Source§

fn is_empty_array_or_object(&self) -> bool

Checks if the value is an empty array or empty object.
Source§

fn is_bool(&self) -> bool

Returns true if the value is a boolean. Returns false otherwise. Read more
Source§

fn is_number(&self) -> bool

Returns true if the value is a number. Returns false otherwise. Read more
Source§

fn is_string(&self) -> bool

Returns true if the value is a string. Returns false otherwise. Read more
Source§

fn is_array(&self) -> bool

Returns true if the value is an array. Returns false otherwise. Read more
Source§

fn is_object(&self) -> bool

Returns true if the value is an object. Returns false otherwise. Read more
Source§

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>

If the value is a number, returns a reference to it. Returns None otherwise.
Source§

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>

Returns this number as an u64 if it can be exactly represented as such.
Source§

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>

Returns this number as an i64 if it can be exactly represented as such.
Source§

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>

Returns this number as an f32 if it is a number, potentially losing precision in the process.
Source§

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>

Returns this number as an f64 if it is a number, potentially losing precision in the process.
Source§

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>

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>

If the value is an array, returns a mutable reference to it. Returns None otherwise.
Source§

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>

If the value is an object, returns a mutable reference to it. Returns None otherwise.
Source§

impl Ord for Null

Source§

fn cmp(&self, other: &Null) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Null

Source§

fn eq(&self, other: &Null) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Null

Source§

fn partial_cmp(&self, other: &Null) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for Null

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.