Enum Value

pub enum Value {
    Static(StaticNode),
    String(String),
    Array(Box<Vec<Value>>),
    Object(Box<SizedHashMap<String, Value>>),
}
Expand description

Owned JSON-DOM Value, consider using the ValueTrait to access it’s content. This is slower then the BorrowedValue as a tradeoff for getting rid of lifetimes.

Variants§

§

Static(StaticNode)

Static values

§

String(String)

string type

§

Array(Box<Vec<Value>>)

array type

§

Object(Box<SizedHashMap<String, Value>>)

object type

Trait Implementations§

§

impl Clone for Value

§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Value

§

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

Formats the value using the given formatter. Read more
§

impl Default for Value

§

fn default() -> Value

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for Value

§

fn deserialize<D>( deserializer: D, ) -> Result<Value, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<'de> Deserializer<'de> for &'de Value

§

type Error = Error

The error type that can be returned if some error occurs during deserialization.
§

fn deserialize_any<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
§

fn deserialize_option<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an optional value. Read more
§

fn deserialize_newtype_struct<V>( self, _name: &'static str, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a newtype struct with a particular name.
§

fn deserialize_struct<V>( self, _name: &'static str, _fields: &'static [&'static str], visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a struct with a particular name and fields.
§

fn deserialize_enum<V>( self, _name: &str, _variants: &'static [&'static str], visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants.
§

fn deserialize_bool<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a bool value.
§

fn deserialize_i8<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i8 value.
§

fn deserialize_i16<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i16 value.
§

fn deserialize_i32<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i32 value.
§

fn deserialize_i64<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i64 value.
§

fn deserialize_i128<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i128 value. Read more
§

fn deserialize_u8<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u8 value.
§

fn deserialize_u16<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u16 value.
§

fn deserialize_u32<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u32 value.
§

fn deserialize_u64<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u64 value.
§

fn deserialize_u128<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an u128 value. Read more
§

fn deserialize_f32<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a f32 value.
§

fn deserialize_f64<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a f64 value.
§

fn deserialize_char<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a char value.
§

fn deserialize_str<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_string<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_bytes<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_byte_buf<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_unit<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a unit value.
§

fn deserialize_unit_struct<V>( self, name: &'static str, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a unit struct with a particular name.
§

fn deserialize_seq<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a sequence of values.
§

fn deserialize_tuple<V>( self, len: usize, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data.
§

fn deserialize_tuple_struct<V>( self, name: &'static str, len: usize, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields.
§

fn deserialize_map<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a map of key-value pairs.
§

fn deserialize_identifier<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant.
§

fn deserialize_ignored_any<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <&'de Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more
Source§

fn is_human_readable(&self) -> bool

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
§

impl<'de> Deserializer<'de> for Value

§

type Error = Error

The error type that can be returned if some error occurs during deserialization.
§

fn deserialize_any<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
§

fn deserialize_option<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an optional value. Read more
§

fn deserialize_enum<V>( self, _name: &str, _variants: &'static [&'static str], visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants.
§

fn deserialize_newtype_struct<V>( self, _name: &'static str, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a newtype struct with a particular name.
§

fn deserialize_struct<V>( self, _name: &'static str, _fields: &'static [&'static str], visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a struct with a particular name and fields.
§

fn deserialize_bool<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a bool value.
§

fn deserialize_i8<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i8 value.
§

fn deserialize_i16<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i16 value.
§

fn deserialize_i32<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i32 value.
§

fn deserialize_i64<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i64 value.
§

fn deserialize_i128<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an i128 value. Read more
§

fn deserialize_u8<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u8 value.
§

fn deserialize_u16<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u16 value.
§

fn deserialize_u32<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u32 value.
§

fn deserialize_u64<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a u64 value.
§

fn deserialize_u128<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting an u128 value. Read more
§

fn deserialize_f32<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a f32 value.
§

fn deserialize_f64<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a f64 value.
§

fn deserialize_char<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a char value.
§

fn deserialize_str<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_string<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_bytes<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_byte_buf<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
§

fn deserialize_unit<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a unit value.
§

fn deserialize_unit_struct<V>( self, name: &'static str, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a unit struct with a particular name.
§

fn deserialize_seq<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a sequence of values.
§

fn deserialize_tuple<V>( self, len: usize, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data.
§

fn deserialize_tuple_struct<V>( self, name: &'static str, len: usize, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields.
§

fn deserialize_map<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting a map of key-value pairs.
§

fn deserialize_identifier<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant.
§

fn deserialize_ignored_any<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, <Value as Deserializer<'de>>::Error>
where V: Visitor<'de>,

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more
Source§

fn is_human_readable(&self) -> bool

Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
§

impl Display for Value

§

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

Formats the value using the given formatter. Read more
§

impl From<&String> for Value

§

fn from(s: &String) -> Value

Converts to this type from the input type.
§

impl From<&str> for Value

§

fn from(s: &str) -> Value

Converts to this type from the input type.
§

impl From<()> for Value

§

fn from(_b: ()) -> Value

Converts to this type from the input type.
§

impl From<Value<'_>> for Value

§

fn from(b: Value<'_>) -> Value

Converts to this type from the input type.
§

impl<'value> From<Cow<'value, str>> for Value

§

fn from(c: Cow<'value, str>) -> Value

Converts to this type from the input type.
§

impl From<HashMap<String, Value>> for Value

§

fn from(v: HashMap<String, Value>) -> Value

Converts to this type from the input type.
§

impl<T> From<Option<T>> for Value
where Value: From<T>,

§

fn from(s: Option<T>) -> Value

Converts to this type from the input type.
§

impl From<Value> for Value<'_>

§

fn from(b: Value) -> Value<'_>

Converts to this type from the input type.
§

impl From<SizedHashMap<String, Value>> for Value

§

fn from(v: SizedHashMap<String, Value>) -> Value

Converts to this type from the input type.
§

impl From<StaticNode> for Value

§

fn from(s: StaticNode) -> Value

Converts to this type from the input type.
§

impl From<String> for Value

§

fn from(s: String) -> Value

Converts to this type from the input type.
§

impl<S> From<Vec<S>> for Value
where Value: From<S>,

§

fn from(v: Vec<S>) -> Value

Converts to this type from the input type.
§

impl From<bool> for Value

§

fn from(b: bool) -> Value

Converts to this type from the input type.
§

impl From<f32> for Value

§

fn from(f: f32) -> Value

Converts to this type from the input type.
§

impl From<f64> for Value

§

fn from(f: f64) -> Value

Converts to this type from the input type.
§

impl From<i16> for Value

§

fn from(i: i16) -> Value

Converts to this type from the input type.
§

impl From<i32> for Value

§

fn from(i: i32) -> Value

Converts to this type from the input type.
§

impl From<i64> for Value

§

fn from(i: i64) -> Value

Converts to this type from the input type.
§

impl From<i8> for Value

§

fn from(i: i8) -> Value

Converts to this type from the input type.
§

impl From<u16> for Value

§

fn from(i: u16) -> Value

Converts to this type from the input type.
§

impl From<u32> for Value

§

fn from(i: u32) -> Value

Converts to this type from the input type.
§

impl From<u64> for Value

§

fn from(i: u64) -> Value

Converts to this type from the input type.
§

impl From<u8> for Value

§

fn from(i: u8) -> Value

Converts to this type from the input type.
§

impl From<usize> for Value

§

fn from(i: usize) -> Value

Converts to this type from the input type.
§

impl<K, V> FromIterator<(K, V)> for Value
where K: ToString, V: Into<Value>,

§

fn from_iter<I>(iter: I) -> Value
where I: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
§

impl<V> FromIterator<V> for Value
where V: Into<Value>,

§

fn from_iter<I>(iter: I) -> Value
where I: IntoIterator<Item = V>,

Creates a value from an iterator. Read more
§

impl Index<&str> for Value

§

type Output = Value

The returned type after indexing.
§

fn index(&self, index: &str) -> &<Value as Index<&str>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl Index<usize> for Value

§

type Output = Value

The returned type after indexing.
§

fn index(&self, index: usize) -> &<Value as Index<usize>>::Output

Performs the indexing (container[index]) operation. Read more
§

impl IndexMut<&str> for Value

§

fn index_mut(&mut self, index: &str) -> &mut <Value as Index<&str>>::Output

Performs the mutable indexing (container[index]) operation. Read more
§

impl IndexMut<usize> for Value

§

fn index_mut(&mut self, index: usize) -> &mut <Value as Index<usize>>::Output

Performs the mutable indexing (container[index]) operation. Read more
§

impl IntoDeserializer<'_, Error> for Value

§

type Deserializer = Value

The type of the deserializer being converted into.
§

fn into_deserializer( self, ) -> <Value as IntoDeserializer<'_, Error>>::Deserializer

Convert this value into a deserializer.
§

impl<T> PartialEq<&[T]> for Value
where Value: PartialEq<T>,

§

fn eq(&self, other: &&[T]) -> 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.
§

impl<T> PartialEq<&T> for Value
where Value: PartialEq<T>,

§

fn eq(&self, other: &&T) -> 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.
§

impl PartialEq<&str> for Value

§

fn eq(&self, other: &&str) -> 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.
§

impl PartialEq<()> for Value

§

fn eq(&self, _other: &()) -> 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.
§

impl PartialEq<Value<'_>> for Value

§

fn eq(&self, other: &Value<'_>) -> 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.
§

impl<K, T, S> PartialEq<HashMap<K, T, S>> for Value
where K: AsRef<str> + Hash + Eq, Value: PartialEq<T>, S: BuildHasher,

§

fn eq(&self, other: &HashMap<K, T, S>) -> 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.
§

impl PartialEq<Value> for Value<'_>

§

fn eq(&self, other: &Value) -> 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.
§

impl PartialEq<String> for Value

§

fn eq(&self, other: &String) -> 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.
§

impl PartialEq<bool> for Value

§

fn eq(&self, other: &bool) -> 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.
§

impl PartialEq<f32> for Value

§

fn eq(&self, other: &f32) -> 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.
§

impl PartialEq<f64> for Value

§

fn eq(&self, other: &f64) -> 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.
§

impl PartialEq<i128> for Value

§

fn eq(&self, other: &i128) -> 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.
§

impl PartialEq<i16> for Value

§

fn eq(&self, other: &i16) -> 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.
§

impl PartialEq<i32> for Value

§

fn eq(&self, other: &i32) -> 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.
§

impl PartialEq<i64> for Value

§

fn eq(&self, other: &i64) -> 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.
§

impl PartialEq<i8> for Value

§

fn eq(&self, other: &i8) -> 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.
§

impl PartialEq<str> for Value

§

fn eq(&self, other: &str) -> 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.
§

impl PartialEq<u128> for Value

§

fn eq(&self, other: &u128) -> 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.
§

impl PartialEq<u16> for Value

§

fn eq(&self, other: &u16) -> 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.
§

impl PartialEq<u32> for Value

§

fn eq(&self, other: &u32) -> 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.
§

impl PartialEq<u64> for Value

§

fn eq(&self, other: &u64) -> 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.
§

impl PartialEq<u8> for Value

§

fn eq(&self, other: &u8) -> 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.
§

impl PartialEq<usize> for Value

§

fn eq(&self, other: &usize) -> 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.
§

impl PartialEq for Value

§

fn eq(&self, other: &Value) -> 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.
§

impl Serialize for Value

§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TryFrom<Value> for Value

§

type Error = SerdeConversionError

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

fn try_from(item: Value) -> Result<Value, SerdeConversionError>

Performs the conversion.
§

impl TryInto<Value> for Value

§

type Error = SerdeConversionError

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

fn try_into(self) -> Result<Value, SerdeConversionError>

Performs the conversion.
§

impl TypedValue for Value

§

fn value_type(&self) -> ValueType

Gets the type of the current value
§

impl ValueAsArray for Value

§

type Array = Vec<Value>

The array structure
§

fn as_array(&self) -> Option<&Vec<Value>>

Tries to represent the value as an array and returns a reference to it
§

impl ValueAsMutArray for Value

§

type Array = Vec<Value>

The type for Arrays
§

fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>

Tries to represent the value as an array and returns a mutable reference to it
§

impl ValueAsMutObject for Value

§

type Object = SizedHashMap<String, Value>

The type for Objects
§

fn as_object_mut(&mut self) -> Option<&mut SizedHashMap<String, Value>>

Tries to represent the value as an object and returns a mutable reference to it
§

impl ValueAsObject for Value

§

type Object = SizedHashMap<String, Value>

The object structure
§

fn as_object(&self) -> Option<&SizedHashMap<String, Value>>

Tries to represent the value as an object and returns a reference to it
§

impl ValueAsScalar for Value

§

fn as_null(&self) -> Option<()>

Tries to represent the value as a ‘null’;
§

fn as_bool(&self) -> Option<bool>

Tries to represent the value as a bool
§

fn as_i64(&self) -> Option<i64>

Tries to represent the value as an i64
§

fn as_i128(&self) -> Option<i128>

Tries to represent the value as an i128
§

fn as_u64(&self) -> Option<u64>

Tries to represent the value as an u64
§

fn as_u128(&self) -> Option<u128>

Tries to represent the value as an u128
§

fn as_f64(&self) -> Option<f64>

Tries to represent the value as a f64
§

fn cast_f64(&self) -> Option<f64>

Casts the current value to a f64 if possible, this will turn integer values into floats.
§

fn as_str(&self) -> Option<&str>

Tries to represent the value as a &str
§

fn as_i32(&self) -> Option<i32>

Tries to represent the value as an i32
§

fn as_i16(&self) -> Option<i16>

Tries to represent the value as an i16
§

fn as_i8(&self) -> Option<i8>

Tries to represent the value as an i8
§

fn as_usize(&self) -> Option<usize>

Tries to represent the value as an usize
§

fn as_u32(&self) -> Option<u32>

Tries to represent the value as an u32
§

fn as_u16(&self) -> Option<u16>

Tries to represent the value as an u16
§

fn as_u8(&self) -> Option<u8>

Tries to represent the value as an u8
§

fn as_f32(&self) -> Option<f32>

Tries to represent the value as a f32
§

fn as_char(&self) -> Option<char>

Tries to represent the value as a Char
§

impl ValueBuilder<'_> for Value

§

fn null() -> Value

Returns anull value
§

fn array_with_capacity(capacity: usize) -> Value

Returns an empty array with a given capacity
§

fn object_with_capacity(capacity: usize) -> Value

Returns an empty object with a given capacity
§

fn array() -> Self

Returns an empty array
§

fn object() -> Self

Returns an empty object
§

impl ValueIntoArray for Value

§

type Array = Vec<Value>

The type for Arrays
§

fn into_array(self) -> Option<<Value as ValueIntoArray>::Array>

Tries to turn the value into it’s array representation
§

impl ValueIntoObject for Value

§

type Object = SizedHashMap<String, Value>

The type for Objects
§

fn into_object(self) -> Option<<Value as ValueIntoObject>::Object>

Tries to turn the value into it’s object representation
§

impl ValueIntoString for Value

§

type String = String

The type for Strings
§

fn into_string(self) -> Option<<Value as ValueIntoString>::String>

Tries to turn the value into it’s string representation
§

impl Writable for Value

§

fn encode(&self) -> String

Encodes the value into it’s JSON representation as a string
§

fn encode_pp(&self) -> String

Encodes the value into it’s JSON representation as a string (pretty printed)
§

fn write<'writer, W>(&self, w: &mut W) -> Result<(), Error>
where W: 'writer + Write,

Encodes the value into it’s JSON representation into a Writer Read more
§

fn write_pp<'writer, W>(&self, w: &mut W) -> Result<(), Error>
where W: 'writer + Write,

Encodes the value into it’s JSON representation into a Writer, pretty printed Read more

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> MutableArray for T
where T: ValueAsMutArray, <T as ValueAsMutArray>::Array: ArrayMut,

§

fn pop(&mut self) -> Result<Option<<T as MutableArray>::Target>, AccessError>

Pops from this Value as an Array. Will return an AccessError::NotAnArray if called on a Value that isn’t an Array - otherwise will behave the same as Vec::pop

§Errors

Will return Err if self is not an array.

§

type Target = <<T as ValueAsMutArray>::Array as ArrayMut>::Element

The type for Array Values
§

fn push<V>(&mut self, v: V) -> Result<(), AccessError>
where V: Into<<T as MutableArray>::Target>,

Pushes to this Value as an Array. Will return an AccessError::NotAnArray if called on a Value that isn’t an Array - otherwise will behave the same as Vec::push Read more
§

fn try_push<V>(&mut self, v: V)
where V: Into<Self::Target>,

Tries to push to a Value if as an Array. This function will have no effect if Value is of a different type
§

fn try_pop(&mut self) -> Option<Self::Target>

Tries to pop from a Value as an Array. if the Value is any other type None will always be returned
§

impl<T> MutableObject for T
where T: ValueAsMutObject, <T as ValueAsMutObject>::Object: ObjectMut,

§

type Key = <<T as ValueAsMutObject>::Object as ObjectMut>::Key

The type for Object Keys
§

type Target = <<T as ValueAsMutObject>::Object as ObjectMut>::Element

The type for Object Values
§

type Object = <T as ValueAsMutObject>::Object

The type for Objects
§

fn insert<K, V>( &mut self, k: K, v: V, ) -> Result<Option<<T as MutableObject>::Target>, AccessError>
where <T as MutableObject>::Key: From<K> + Hash + Eq, V: Into<<T as MutableObject>::Target>,

Insert into this Value as an Object. Will return an AccessError::NotAnObject if called on a Value that isn’t an object - otherwise will behave the same as HashMap::insert Read more
§

fn remove<Q>( &mut self, k: &Q, ) -> Result<Option<<T as MutableObject>::Target>, AccessError>
where <T as MutableObject>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Remove from this Value as an Object. Will return an AccessError::NotAnObject if called on a Value that isn’t an object - otherwise will behave the same as HashMap::remove Read more
§

fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut <T as MutableObject>::Target>
where <T as MutableObject>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Same as get but returns a mutable ref instead
§

fn try_insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Target>
where Self::Key: From<K> + Hash + Eq, V: Into<Self::Target>,

Tries to insert into this Value as an Object. If the Value isn’t an object this opoeration will return None and have no effect.
§

fn try_remove<Q>(&mut self, k: &Q) -> Option<Self::Target>
where Self::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to remove from this Value as an Object. If the Value isn’t an object this opoeration will return None and have no effect.
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToStringFallible for T
where T: Display,

§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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.
§

impl<T> TypedArrayValue for T
where T: ValueAsArray,

§

fn is_array(&self) -> bool

returns true if the current value can be represented as an array
§

impl<T> TypedObjectValue for T
where T: ValueAsObject,

§

fn is_object(&self) -> bool

returns true if the current value can be represented as an object
§

impl<T> TypedScalarValue for T
where T: ValueAsScalar,

§

fn is_null(&self) -> bool

returns true if the current value is null
§

fn is_float(&self) -> bool

returns true if the current value a floatingpoint number
§

fn is_integer(&self) -> bool

returns true if the current value a integer number
§

fn is_number(&self) -> bool

returns true if the current value a number either float or intege
§

fn is_bool(&self) -> bool

returns true if the current value a bool
§

fn is_i128(&self) -> bool

returns true if the current value can be represented as a i128
§

fn is_i64(&self) -> bool

returns true if the current value can be represented as a i64
§

fn is_i32(&self) -> bool

returns true if the current value can be represented as a i32
§

fn is_i16(&self) -> bool

returns true if the current value can be represented as a i16
§

fn is_i8(&self) -> bool

returns true if the current value can be represented as a i8
§

fn is_u128(&self) -> bool

returns true if the current value can be represented as a u128
§

fn is_u64(&self) -> bool

returns true if the current value can be represented as a u64
§

fn is_usize(&self) -> bool

returns true if the current value can be represented as a usize
§

fn is_u32(&self) -> bool

returns true if the current value can be represented as a u32
§

fn is_u16(&self) -> bool

returns true if the current value can be represented as a u16
§

fn is_u8(&self) -> bool

returns true if the current value can be represented as a u8
§

fn is_f64(&self) -> bool

returns true if the current value can be represented as a f64
§

fn is_f64_castable(&self) -> bool

returns true if the current value can be cast into a f64
§

fn is_f32(&self) -> bool

returns true if the current value can be represented as a f64
§

fn is_str(&self) -> bool

returns true if the current value can be represented as a str
§

fn is_char(&self) -> bool

returns true if the current value can be represented as a char
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ValueArrayTryAccess for T
where T: ValueTryAsArray, <T as ValueTryAsArray>::Array: Indexed<usize>,

§

fn try_get_idx( &self, i: usize, ) -> Result<Option<&<T as ValueArrayTryAccess>::Target>, TryTypeError>

Tries to get a value based on n index, returns a type error if the current value isn’t an Array, returns None if the index is out of bounds

§Errors

if the requested type doesn’t match the actual type or the value is not an object

§

type Target = <<T as ValueTryAsArray>::Array as Indexed<usize>>::Element

The target for nested lookups
§

impl<T> ValueObjectAccess for T
where T: ValueAsObject,

§

type Key = <<T as ValueAsObject>::Object as Object>::Key

The type for Objects
§

type Target = <<T as ValueAsObject>::Object as Object>::Element

The target for nested lookups
§

fn get<Q>(&self, k: &Q) -> Option<&<T as ValueObjectAccess>::Target>
where <T as ValueObjectAccess>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Gets a ref to a value based on a key, returns None if the current Value isn’t an Object or doesn’t contain the key it was asked for.
§

fn contains_key<Q>(&self, k: &Q) -> bool
where <T as ValueObjectAccess>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Checks if a Value contains a given key. This will return flase if Value isn’t an object
§

impl<T> ValueObjectAccessAsArray for T
where T: ValueObjectAccess, <T as ValueObjectAccess>::Target: ValueAsArray,

§

type Key = <T as ValueObjectAccess>::Key

The type for Objects
§

type Array = <<T as ValueObjectAccess>::Target as ValueAsArray>::Array

The array structure
§

fn get_array<Q>(&self, k: &Q) -> Option<&<T as ValueObjectAccessAsArray>::Array>
where <T as ValueObjectAccessAsArray>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a array
§

impl<T> ValueObjectAccessAsObject for T
where T: ValueObjectAccess, <T as ValueObjectAccess>::Target: ValueAsObject,

§

type Key = <T as ValueObjectAccess>::Key

The type for Objects
§

type Object = <<T as ValueObjectAccess>::Target as ValueAsObject>::Object

The object structure
§

fn get_object<Q>( &self, k: &Q, ) -> Option<&<T as ValueObjectAccessAsObject>::Object>
where <T as ValueObjectAccessAsObject>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a object
§

impl<T> ValueObjectAccessAsScalar for T
where T: ValueObjectAccess, <T as ValueObjectAccess>::Target: ValueAsScalar,

§

type Key = <T as ValueObjectAccess>::Key

The type for Objects
§

fn get_bool<Q>(&self, k: &Q) -> Option<bool>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a bool
§

fn get_i128<Q>(&self, k: &Q) -> Option<i128>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i128
§

fn get_i64<Q>(&self, k: &Q) -> Option<i64>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i64
§

fn get_i32<Q>(&self, k: &Q) -> Option<i32>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i32
§

fn get_i16<Q>(&self, k: &Q) -> Option<i16>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i16
§

fn get_i8<Q>(&self, k: &Q) -> Option<i8>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i8
§

fn get_u128<Q>(&self, k: &Q) -> Option<u128>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u128
§

fn get_u64<Q>(&self, k: &Q) -> Option<u64>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u64
§

fn get_usize<Q>(&self, k: &Q) -> Option<usize>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a usize
§

fn get_u32<Q>(&self, k: &Q) -> Option<u32>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u32
§

fn get_u16<Q>(&self, k: &Q) -> Option<u16>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u16
§

fn get_u8<Q>(&self, k: &Q) -> Option<u8>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u8
§

fn get_f64<Q>(&self, k: &Q) -> Option<f64>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a f64
§

fn get_f32<Q>(&self, k: &Q) -> Option<f32>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a f32
§

fn get_str<Q>(&self, k: &Q) -> Option<&str>
where <T as ValueObjectAccessAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a str
§

impl<T> ValueObjectAccessTryAsArray for T
where T: ValueObjectTryAccess + TypedValue, <T as ValueObjectTryAccess>::Target: ValueTryAsArray,

§

type Key = <T as ValueObjectTryAccess>::Key

The type for Objects
§

type Array = <<T as ValueObjectTryAccess>::Target as ValueTryAsArray>::Array

The array structure
§

fn try_get_array<Q>( &self, k: &Q, ) -> Result<Option<&<T as ValueObjectAccessTryAsArray>::Array>, TryTypeError>
where <T as ValueObjectAccessTryAsArray>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as an array, returns an error if it isn’t a array Read more
§

impl<T> ValueObjectAccessTryAsObject for T
where T: ValueObjectTryAccess + TypedValue, <T as ValueObjectTryAccess>::Target: ValueTryAsObject,

§

type Key = <T as ValueObjectTryAccess>::Key

The type for Objects
§

type Object = <<T as ValueObjectTryAccess>::Target as ValueTryAsObject>::Object

The object structure
§

fn try_get_object<Q>( &self, k: &Q, ) -> Result<Option<&<T as ValueObjectAccessTryAsObject>::Object>, TryTypeError>
where <T as ValueObjectAccessTryAsObject>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as an object, returns an error if it isn’t an object Read more
§

impl<T> ValueObjectAccessTryAsScalar for T
where T: ValueObjectTryAccess + TypedValue, <T as ValueObjectTryAccess>::Target: ValueTryAsScalar,

§

type Key = <T as ValueObjectTryAccess>::Key

The type for Objects
§

fn try_get_bool<Q>(&self, k: &Q) -> Result<Option<bool>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a bool, returns an error if it isn’t bool Read more
§

fn try_get_i128<Q>(&self, k: &Q) -> Result<Option<i128>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i128, returns an error if it isn’t i128 Read more
§

fn try_get_i64<Q>(&self, k: &Q) -> Result<Option<i64>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i64, returns an error if it isn’t a i64 Read more
§

fn try_get_i32<Q>(&self, k: &Q) -> Result<Option<i32>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i32, returns an error if it isn’t a i32 Read more
§

fn try_get_i16<Q>(&self, k: &Q) -> Result<Option<i16>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i16, returns an error if it isn’t a i16 Read more
§

fn try_get_i8<Q>(&self, k: &Q) -> Result<Option<i8>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a i8, returns an error if it isn’t a i8 Read more
§

fn try_get_u128<Q>(&self, k: &Q) -> Result<Option<u128>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u128, returns an error if it isn’t a u128 Read more
§

fn try_get_u64<Q>(&self, k: &Q) -> Result<Option<u64>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u64, returns an error if it isn’t a u64 Read more
§

fn try_get_usize<Q>(&self, k: &Q) -> Result<Option<usize>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a usize, returns an error if it isn’t a usize Read more
§

fn try_get_u32<Q>(&self, k: &Q) -> Result<Option<u32>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u32, returns an error if it isn’t a u32 Read more
§

fn try_get_u16<Q>(&self, k: &Q) -> Result<Option<u16>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u16, returns an error if it isn’t a u16 Read more
§

fn try_get_u8<Q>(&self, k: &Q) -> Result<Option<u8>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a u8, returns an error if it isn’t a u8 Read more
§

fn try_get_f64<Q>(&self, k: &Q) -> Result<Option<f64>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a f64, returns an error if it isn’t a f64 Read more
§

fn try_get_f32<Q>(&self, k: &Q) -> Result<Option<f32>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a f32, returns an error if it isn’t a f32 Read more
§

fn try_get_str<Q>(&self, k: &Q) -> Result<Option<&str>, TryTypeError>
where <T as ValueObjectAccessTryAsScalar>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get an element of an object as a str, returns an error if it isn’t a str Read more
§

impl<T> ValueObjectTryAccess for T
where T: ValueTryAsObject,

§

type Key = <<T as ValueTryAsObject>::Object as Object>::Key

The type for Objects
§

type Target = <<T as ValueTryAsObject>::Object as Object>::Element

The target for nested lookups
§

fn try_get<Q>( &self, k: &Q, ) -> Result<Option<&<T as ValueObjectTryAccess>::Target>, TryTypeError>
where <T as ValueObjectTryAccess>::Key: Borrow<Q>, Q: Hash + Eq + Ord + ?Sized,

Tries to get a value based on a key, returns a TryTypeError if the current Value isn’t an Object, returns None if the key isn’t in the object Read more
§

impl<T> ValueTryAsArray for T
where T: ValueAsArray + TypedValue,

§

type Array = <T as ValueAsArray>::Array

The array structure
§

fn try_as_array(&self) -> Result<&<T as ValueTryAsArray>::Array, TryTypeError>

Tries to represent the value as an array and returns a reference to it Read more
§

impl<T> ValueTryAsArrayMut for T
where T: ValueAsMutArray + TypedValue, <T as ValueAsMutArray>::Array: Array,

§

type Array = <T as ValueAsMutArray>::Array

The array structure
§

fn try_as_array_mut( &mut self, ) -> Result<&mut <T as ValueTryAsArrayMut>::Array, TryTypeError>

Tries to represent the value as an array and returns a mutable reference to it Read more
§

impl<T> ValueTryAsMutObject for T
where T: ValueAsMutObject + TypedValue,

§

type Object = <T as ValueAsMutObject>::Object

The type for Objects
§

fn try_as_object_mut( &mut self, ) -> Result<&mut <T as ValueTryAsMutObject>::Object, TryTypeError>

Tries to represent the value as an object and returns a mutable reference to it Read more
§

impl<T> ValueTryAsObject for T
where T: ValueAsObject + TypedValue,

§

type Object = <T as ValueAsObject>::Object

The object structure
§

fn try_as_object( &self, ) -> Result<&<T as ValueTryAsObject>::Object, TryTypeError>

Tries to represent the value as an object and returns a reference to it Read more
§

impl<T> ValueTryAsScalar for T
where T: ValueAsScalar + TypedValue,

§

fn try_as_bool(&self) -> Result<bool, TryTypeError>

Tries to represent the value as a bool Read more
§

fn try_as_i128(&self) -> Result<i128, TryTypeError>

Tries to represent the value as a i128 Read more
§

fn try_as_i64(&self) -> Result<i64, TryTypeError>

Tries to represent the value as an i64 Read more
§

fn try_as_i32(&self) -> Result<i32, TryTypeError>

Tries to represent the value as an i32 Read more
§

fn try_as_i16(&self) -> Result<i16, TryTypeError>

Tries to represent the value as an i16 Read more
§

fn try_as_i8(&self) -> Result<i8, TryTypeError>

Tries to represent the value as an i8 Read more
§

fn try_as_u128(&self) -> Result<u128, TryTypeError>

Tries to represent the value as an u128 Read more
§

fn try_as_u64(&self) -> Result<u64, TryTypeError>

Tries to represent the value as an u64 Read more
§

fn try_as_usize(&self) -> Result<usize, TryTypeError>

Tries to represent the value as an usize Read more
§

fn try_as_u32(&self) -> Result<u32, TryTypeError>

Tries to represent the value as an u32 Read more
§

fn try_as_u16(&self) -> Result<u16, TryTypeError>

Tries to represent the value as an u16 Read more
§

fn try_as_u8(&self) -> Result<u8, TryTypeError>

Tries to represent the value as an u8 Read more
§

fn try_as_f64(&self) -> Result<f64, TryTypeError>

Tries to represent the value as a f64 Read more
§

fn try_cast_f64(&self) -> Result<f64, TryTypeError>

Tries to Casts the current value to a f64 if possible, this will turn integer values into floats and error if it isn’t possible Read more
§

fn try_as_f32(&self) -> Result<f32, TryTypeError>

Tries to represent the value as a f32 Read more
§

fn try_as_str(&self) -> Result<&str, TryTypeError>

Tries to represent the value as a &str Read more
§

fn try_as_char(&self) -> Result<char, TryTypeError>

Tries to represent the value as a Char Read more
§

impl<T> ValueTryIntoArray for T
where T: ValueIntoArray + TypedValue,

§

fn try_into_array(self) -> Result<<T as ValueTryIntoArray>::Array, TryTypeError>

Tries to turn the value into it’s array representation

§Errors

if the requested type doesn’t match the actual type

§

type Array = <T as ValueIntoArray>::Array

The type for Arrays
§

impl<T> ValueTryIntoObject for T
where T: ValueIntoObject + TypedValue,

§

fn try_into_object( self, ) -> Result<<T as ValueTryIntoObject>::Object, TryTypeError>

Tries to turn the value into it’s object representation

§Errors

if the requested type doesn’t match the actual type

§

type Object = <T as ValueIntoObject>::Object

The type for Objects
§

impl<T> ValueTryIntoString for T
where T: ValueIntoString + TypedValue,

§

type String = <T as ValueIntoString>::String

The type for Strings
§

fn try_into_string( self, ) -> Result<<T as ValueTryIntoString>::String, TryTypeError>

Tries to turn the value into it’s string representation Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,