simd_json::value::borrowed

Enum Value

source
pub enum Value<'value> {
    Static(StaticNode),
    String(Cow<'value, str>),
    Array(Box<Vec<Value<'value>>>),
    Object(Box<Object<'value>>),
}
Expand description

Borrowed JSON-DOM Value, consider using the ValueTrait to access its content

Variants§

§

Static(StaticNode)

Static values

§

String(Cow<'value, str>)

string type

§

Array(Box<Vec<Value<'value>>>)

array type

§

Object(Box<Object<'value>>)

object type

Implementations§

source§

impl<'value> Value<'value>

source

pub fn into_static(self) -> Value<'static>

Enforces static lifetime on a borrowed value, this will force all strings to become owned COW’s, the same applies for Object keys.

source

pub fn clone_static(&self) -> Value<'static>

Clones the current value and enforces a static lifetime, it works the same as into_static but includes cloning logic

Trait Implementations§

source§

impl<'value> Clone for Value<'value>

source§

fn clone(&self) -> Value<'value>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<'value> Debug for Value<'value>

source§

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

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

impl<'value> Default for Value<'value>

source§

fn default() -> Self

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

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

source§

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

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

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

source§

type Error = Error

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

fn deserialize_any<V>(self, visitor: V) -> Result<V::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
source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fn deserialize_str<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

fn deserialize_string<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

fn deserialize_bytes<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

fn deserialize_byte_buf<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

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

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

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

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

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

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

fn deserialize_tuple<V>( self, len: usize, visitor: V, ) -> Result<V::Value, <Self 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.
source§

fn deserialize_tuple_struct<V>( self, name: &'static str, len: usize, visitor: V, ) -> Result<V::Value, <Self 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.
source§

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

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

fn deserialize_identifier<V>( self, visitor: V, ) -> Result<V::Value, <Self 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.
source§

fn deserialize_ignored_any<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

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

source§

type Error = Error

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

fn deserialize_any<V>(self, visitor: V) -> Result<V::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
source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fn deserialize_str<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

fn deserialize_string<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

fn deserialize_bytes<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

fn deserialize_byte_buf<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

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

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

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

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

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

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

fn deserialize_tuple<V>( self, len: usize, visitor: V, ) -> Result<V::Value, <Self 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.
source§

fn deserialize_tuple_struct<V>( self, name: &'static str, len: usize, visitor: V, ) -> Result<V::Value, <Self 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.
source§

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

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

fn deserialize_identifier<V>( self, visitor: V, ) -> Result<V::Value, <Self 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.
source§

fn deserialize_ignored_any<V>( self, visitor: V, ) -> Result<V::Value, <Self 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
source§

impl<'value> Display for Value<'value>

source§

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

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

impl<'value> From<&'value str> for Value<'value>

source§

fn from(s: &'value str) -> Self

Converts to this type from the input type.
source§

impl<'value> From<()> for Value<'value>

source§

fn from(_b: ()) -> Self

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

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

source§

fn from(v: Object<'value>) -> Self

Converts to this type from the input type.
source§

impl<'value> From<StaticNode> for Value<'value>

source§

fn from(s: StaticNode) -> Self

Converts to this type from the input type.
source§

impl<'value> From<String> for Value<'value>

source§

fn from(s: String) -> Self

Converts to this type from the input type.
source§

impl From<Value<'_>> for Value

source§

fn from(b: BorrowedValue<'_>) -> Self

Converts to this type from the input type.
source§

impl<'borrow, 'tape, 'value> From<Value<'value>> for Value<'borrow, 'tape, 'value>

source§

fn from(v: Value<'value>) -> Self

Converts to this type from the input type.
source§

impl<'value> From<Value> for Value<'value>

source§

fn from(b: OwnedValue) -> Self

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl<'value> From<bool> for Value<'value>

source§

fn from(b: bool) -> Self

Converts to this type from the input type.
source§

impl<'value> From<f32> for Value<'value>

source§

fn from(f: f32) -> Self

Converts to this type from the input type.
source§

impl<'value> From<f64> for Value<'value>

source§

fn from(f: f64) -> Self

Converts to this type from the input type.
source§

impl<'value> From<i16> for Value<'value>

source§

fn from(i: i16) -> Self

Converts to this type from the input type.
source§

impl<'value> From<i32> for Value<'value>

source§

fn from(i: i32) -> Self

Converts to this type from the input type.
source§

impl<'value> From<i64> for Value<'value>

source§

fn from(i: i64) -> Self

Converts to this type from the input type.
source§

impl<'value> From<i8> for Value<'value>

source§

fn from(i: i8) -> Self

Converts to this type from the input type.
source§

impl<'value> From<u16> for Value<'value>

source§

fn from(i: u16) -> Self

Converts to this type from the input type.
source§

impl<'value> From<u32> for Value<'value>

source§

fn from(i: u32) -> Self

Converts to this type from the input type.
source§

impl<'value> From<u64> for Value<'value>

source§

fn from(i: u64) -> Self

Converts to this type from the input type.
source§

impl<'value> From<u8> for Value<'value>

source§

fn from(i: u8) -> Self

Converts to this type from the input type.
source§

impl<'value> From<usize> for Value<'value>

source§

fn from(i: usize) -> Self

Converts to this type from the input type.
source§

impl<'value, K: Into<Cow<'value, str>>, V: Into<Value<'value>>> FromIterator<(K, V)> for Value<'value>

source§

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

Creates a value from an iterator. Read more
source§

impl<'value, V: Into<Value<'value>>> FromIterator<V> for Value<'value>

source§

fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<'value> Index<&str> for Value<'value>

source§

type Output = Value<'value>

The returned type after indexing.
source§

fn index(&self, index: &str) -> &Self::Output

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

impl<'value> Index<usize> for Value<'value>

source§

type Output = Value<'value>

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

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

impl<'value> IndexMut<&str> for Value<'value>

source§

fn index_mut(&mut self, index: &str) -> &mut Self::Output

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

impl<'value> IndexMut<usize> for Value<'value>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

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

impl<'de> IntoDeserializer<'de, Error> for Value<'de>

source§

type Deserializer = Value<'de>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.
source§

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

source§

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

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

source§

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

impl<'v> PartialEq<&str> for Value<'v>

source§

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

impl<'v> PartialEq<()> for Value<'v>

source§

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

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

source§

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

impl<'v> PartialEq<String> for Value<'v>

source§

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

impl PartialEq<Value<'_>> for Value

source§

fn eq(&self, other: &BorrowedValue<'_>) -> 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<'value> PartialEq<Value> for Value<'value>

source§

fn eq(&self, other: &OwnedValue) -> 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<'v> PartialEq<bool> for Value<'v>

source§

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

impl<'v> PartialEq<f32> for Value<'v>

source§

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

impl<'v> PartialEq<f64> for Value<'v>

source§

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

impl<'v> PartialEq<i128> for Value<'v>

source§

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

impl<'v> PartialEq<i16> for Value<'v>

source§

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

impl<'v> PartialEq<i32> for Value<'v>

source§

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

impl<'v> PartialEq<i64> for Value<'v>

source§

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

impl<'v> PartialEq<i8> for Value<'v>

source§

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

impl<'v> PartialEq<str> for Value<'v>

source§

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

impl<'v> PartialEq<u128> for Value<'v>

source§

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

impl<'v> PartialEq<u16> for Value<'v>

source§

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

impl<'v> PartialEq<u32> for Value<'v>

source§

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

impl<'v> PartialEq<u64> for Value<'v>

source§

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

impl<'v> PartialEq<u8> for Value<'v>

source§

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

impl<'v> PartialEq<usize> for Value<'v>

source§

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

impl<'value> PartialEq for Value<'value>

source§

fn eq(&self, other: &Self) -> 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<'value> Serialize for Value<'value>

source§

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

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

impl<'value> TryFrom<Value> for BorrowedValue<'value>

source§

type Error = SerdeConversionError

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

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

Performs the conversion.
source§

impl<'value> TryInto<Value> for BorrowedValue<'value>

source§

type Error = SerdeConversionError

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

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

Performs the conversion.
source§

impl<'value> TypedValue for Value<'value>

source§

fn value_type(&self) -> ValueType

Gets the type of the current value
source§

impl<'value> ValueAsArray for Value<'value>

source§

type Array = Vec<Value<'value>>

The array structure
source§

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

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

impl<'value> ValueAsMutArray for Value<'value>

source§

type Array = Vec<Value<'value>>

The type for Arrays
source§

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

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

impl<'value> ValueAsMutObject for Value<'value>

source§

fn as_object_mut(&mut self) -> Option<&mut Object<'value>>

Get mutable access to a map.

use simd_json::*;
use value_trait::prelude::*;

let mut object: BorrowedValue = json!({
  "answer": 23,
  "key": 7
}).into();
assert_eq!(object["answer"], 23);

if let Some(inner) = object.as_object_mut() {
  inner.insert("value".into(), BorrowedValue::from(json!({"nested": 42})));
}
assert_eq!(object["value"], json!({"nested": 42}));
source§

type Object = SizedHashMap<Cow<'value, str>, Value<'value>>

The type for Objects
source§

impl<'value> ValueAsObject for Value<'value>

source§

type Object = SizedHashMap<Cow<'value, str>, Value<'value>>

The object structure
source§

fn as_object(&self) -> Option<&Object<'value>>

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

impl<'value> ValueAsScalar for Value<'value>

source§

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

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

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

Tries to represent the value as a bool
source§

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

Tries to represent the value as an i64
source§

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

Tries to represent the value as an i128
source§

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

Tries to represent the value as an u64
source§

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

Tries to represent the value as an u128
source§

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

Tries to represent the value as a f64
source§

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

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

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

Tries to represent the value as a &str
source§

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

Tries to represent the value as an i32
source§

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

Tries to represent the value as an i16
source§

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

Tries to represent the value as an i8
source§

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

Tries to represent the value as an usize
source§

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

Tries to represent the value as an u32
source§

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

Tries to represent the value as an u16
source§

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

Tries to represent the value as an u8
source§

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

Tries to represent the value as a f32
source§

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

Tries to represent the value as a Char
source§

impl<'value> ValueBuilder<'value> for Value<'value>

source§

fn null() -> Self

Returns anull value
source§

fn array_with_capacity(capacity: usize) -> Self

Returns an empty array with a given capacity
source§

fn object_with_capacity(capacity: usize) -> Self

Returns an empty object with a given capacity
source§

fn array() -> Self

Returns an empty array
source§

fn object() -> Self

Returns an empty object
source§

impl<'value> ValueIntoArray for Value<'value>

source§

type Array = Vec<Value<'value>>

The type for Arrays
source§

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

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

impl<'value> ValueIntoObject for Value<'value>

source§

type Object = SizedHashMap<Cow<'value, str>, Value<'value>>

The type for Objects
source§

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

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

impl<'value> ValueIntoString for Value<'value>

source§

type String = Cow<'value, str>

The type for Strings
source§

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

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

impl<'value> Writable for Value<'value>

source§

fn encode(&self) -> String

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

fn encode_pp(&self) -> String

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

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

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

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

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

Auto Trait Implementations§

§

impl<'value> Freeze for Value<'value>

§

impl<'value> RefUnwindSafe for Value<'value>

§

impl<'value> Send for Value<'value>

§

impl<'value> Sync for Value<'value>

§

impl<'value> Unpin for Value<'value>

§

impl<'value> UnwindSafe for Value<'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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
source§

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

source§

fn is_array(&self) -> bool

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

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

source§

fn is_object(&self) -> bool

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

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

source§

fn is_null(&self) -> bool

returns true if the current value is null
source§

fn is_float(&self) -> bool

returns true if the current value a floatingpoint number
source§

fn is_integer(&self) -> bool

returns true if the current value a integer number
source§

fn is_number(&self) -> bool

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

fn is_bool(&self) -> bool

returns true if the current value a bool
source§

fn is_i128(&self) -> bool

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

fn is_i64(&self) -> bool

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

fn is_i32(&self) -> bool

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

fn is_i16(&self) -> bool

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

fn is_i8(&self) -> bool

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

fn is_u128(&self) -> bool

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

fn is_u64(&self) -> bool

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

fn is_usize(&self) -> bool

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

fn is_u32(&self) -> bool

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

fn is_u16(&self) -> bool

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

fn is_u8(&self) -> bool

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

fn is_f64(&self) -> bool

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

fn is_f64_castable(&self) -> bool

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

fn is_f32(&self) -> bool

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

fn is_str(&self) -> bool

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

fn is_char(&self) -> bool

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

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

source§

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

The type for Objects
source§

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

The target for nested lookups
source§

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

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

impl<T> ValueObjectAccessTryAsArray for T

source§

type Key = <T as ValueObjectTryAccess>::Key

The type for Objects
source§

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

The array structure
source§

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

impl<T> ValueObjectAccessTryAsObject for T

source§

type Key = <T as ValueObjectTryAccess>::Key

The type for Objects
source§

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

The object structure
source§

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

impl<T> ValueObjectAccessTryAsScalar for T

source§

type Key = <T as ValueObjectTryAccess>::Key

The type for Objects
source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<T> ValueObjectTryAccess for T

source§

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

The type for Objects
source§

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

The target for nested lookups
source§

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

impl<T> ValueTryAsArray for T

source§

type Array = <T as ValueAsArray>::Array

The array structure
source§

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

impl<T> ValueTryAsMutObject for T

source§

type Object = <T as ValueAsMutObject>::Object

The type for Objects
source§

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

impl<T> ValueTryAsObject for T

source§

type Object = <T as ValueAsObject>::Object

The object structure
source§

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

impl<T> ValueTryAsScalar for T

source§

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

Tries to represent the value as a bool Read more
source§

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

Tries to represent the value as a i128 Read more
source§

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

Tries to represent the value as an i64 Read more
source§

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

Tries to represent the value as an i32 Read more
source§

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

Tries to represent the value as an i16 Read more
source§

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

Tries to represent the value as an i8 Read more
source§

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

Tries to represent the value as an u128 Read more
source§

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

Tries to represent the value as an u64 Read more
source§

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

Tries to represent the value as an usize Read more
source§

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

Tries to represent the value as an u32 Read more
source§

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

Tries to represent the value as an u16 Read more
source§

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

Tries to represent the value as an u8 Read more
source§

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

Tries to represent the value as a f64 Read more
source§

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

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

Tries to represent the value as a f32 Read more
source§

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

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

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

Tries to represent the value as a Char Read more
source§

impl<T> ValueTryIntoArray for T

source§

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

source§

type Array = <T as ValueIntoArray>::Array

The type for Arrays
source§

impl<T> ValueTryIntoObject for T

source§

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

source§

type Object = <T as ValueIntoObject>::Object

The type for Objects
source§

impl<T> ValueTryIntoString for T

source§

type String = <T as ValueIntoString>::String

The type for Strings
source§

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

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