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(Vec<Value>)
array type
Object(Box<Object>)
object type
Trait Implementations
sourceimpl<'input> Builder<'input> for Value
impl<'input> Builder<'input> for Value
sourcefn array_with_capacity(capacity: usize) -> Self
fn array_with_capacity(capacity: usize) -> Self
Returns an empty array with a given capacity
sourcefn object_with_capacity(capacity: usize) -> Self
fn object_with_capacity(capacity: usize) -> Self
Returns an empty object with a given capacity
sourceimpl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'de> Deserializer<'de> for &'de Value
impl<'de> Deserializer<'de> for &'de Value
type Error = Error
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
sourcefn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>,
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
sourcefn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>,
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
sourcefn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
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. Read more
sourcefn deserialize_struct<V>(
self,
_name: &'static str,
_fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
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. Read more
sourcefn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
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. Read more
sourcefn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a bool
value.
sourcefn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i8
value.
sourcefn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i16
value.
sourcefn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i32
value.
sourcefn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i64
value.
sourcefn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i128
value. Read more
sourcefn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u8
value.
sourcefn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u16
value.
sourcefn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u32
value.
sourcefn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u64
value.
sourcefn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an u128
value. Read more
sourcefn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a f32
value.
sourcefn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a f64
value.
sourcefn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a char
value.
sourcefn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a unit value.
sourcefn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a unit struct with a
particular name. Read more
sourcefn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a sequence of values.
sourcefn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::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. Read more
sourcefn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a tuple struct with a
particular name and number of fields. Read more
sourcefn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a map of key-value pairs.
sourcefn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::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. Read more
sourcefn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether Deserialize
implementations should expect to
deserialize their human-readable form. Read more
sourceimpl<'de> Deserializer<'de> for Value
impl<'de> Deserializer<'de> for Value
type Error = Error
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
sourcefn deserialize_any<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>,
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
sourcefn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Error> where
V: Visitor<'de>,
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
sourcefn deserialize_enum<V>(
self,
_name: &str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
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. Read more
sourcefn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
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. Read more
sourcefn deserialize_struct<V>(
self,
_name: &'static str,
_fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Error> where
V: Visitor<'de>,
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. Read more
sourcefn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a bool
value.
sourcefn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i8
value.
sourcefn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i16
value.
sourcefn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i32
value.
sourcefn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i64
value.
sourcefn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an i128
value. Read more
sourcefn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u8
value.
sourcefn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u16
value.
sourcefn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u32
value.
sourcefn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a u64
value.
sourcefn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting an u128
value. Read more
sourcefn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a f32
value.
sourcefn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a f64
value.
sourcefn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a char
value.
sourcefn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a unit value.
sourcefn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a unit struct with a
particular name. Read more
sourcefn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a sequence of values.
sourcefn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::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. Read more
sourcefn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a tuple struct with a
particular name and number of fields. Read more
sourcefn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a map of key-value pairs.
sourcefn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::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. Read more
sourcefn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::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
sourcefn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether Deserialize
implementations should expect to
deserialize their human-readable form. Read more
sourceimpl From<StaticNode> for Value
impl From<StaticNode> for Value
sourcefn from(s: StaticNode) -> Self
fn from(s: StaticNode) -> Self
Converts to this type from the input type.
sourceimpl From<Value<'_>> for Value
impl From<Value<'_>> for Value
sourcefn from(b: BorrowedValue<'_>) -> Self
fn from(b: BorrowedValue<'_>) -> Self
Converts to this type from the input type.
sourceimpl<'value> From<Value> for Value<'value>
impl<'value> From<Value> for Value<'value>
sourcefn from(b: OwnedValue) -> Self
fn from(b: OwnedValue) -> Self
Converts to this type from the input type.
sourceimpl<K: ToString, V: Into<Value>> FromIterator<(K, V)> for Value
impl<K: ToString, V: Into<Value>> FromIterator<(K, V)> for Value
sourcefn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
Creates a value from an iterator. Read more
sourceimpl<V: Into<Value>> FromIterator<V> for Value
impl<V: Into<Value>> FromIterator<V> for Value
sourcefn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
Creates a value from an iterator. Read more
sourceimpl<'de> IntoDeserializer<'de, Error> for Value
impl<'de> IntoDeserializer<'de, Error> for Value
type Deserializer = Value
type Deserializer = Value
The type of the deserializer being converted into.
sourcefn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
sourceimpl Mutable for Value
impl Mutable for Value
sourcefn as_array_mut(&mut self) -> Option<&mut Vec<Self>>
fn as_array_mut(&mut self) -> Option<&mut Vec<Self>>
Tries to represent the value as an array and returns a mutable refference to it
sourcefn as_object_mut(&mut self) -> Option<&mut HashMap<Self::Key, Self>>
fn as_object_mut(&mut self) -> Option<&mut HashMap<Self::Key, Self>>
Tries to represent the value as an object and returns a mutable refference to it
sourcefn insert<K, V>(
&mut self,
k: K,
v: V
) -> Result<Option<Self::Target>, AccessError> where
K: Into<Self::Key>,
V: Into<Self::Target>,
Self::Key: Hash,
Self::Key: Eq,
fn insert<K, V>(
&mut self,
k: K,
v: V
) -> Result<Option<Self::Target>, AccessError> where
K: Into<Self::Key>,
V: Into<Self::Target>,
Self::Key: Hash,
Self::Key: Eq,
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
sourcefn try_insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Target> where
K: Into<Self::Key>,
V: Into<Self::Target>,
Self::Key: Hash,
Self::Key: Eq,
fn try_insert<K, V>(&mut self, k: K, v: V) -> Option<Self::Target> where
K: Into<Self::Key>,
V: Into<Self::Target>,
Self::Key: Hash,
Self::Key: Eq,
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. Read more
sourcefn remove<Q>(&mut self, k: &Q) -> Result<Option<Self::Target>, AccessError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn remove<Q>(&mut self, k: &Q) -> Result<Option<Self::Target>, AccessError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
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
sourcefn try_remove<Q>(&mut self, k: &Q) -> Option<Self::Target> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_remove<Q>(&mut self, k: &Q) -> Option<Self::Target> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
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. Read more
sourcefn push<V>(&mut self, v: V) -> Result<(), AccessError> where
V: Into<Self::Target>,
fn push<V>(&mut self, v: V) -> Result<(), AccessError> where
V: Into<Self::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
sourcefn try_push<V>(&mut self, v: V) where
V: Into<Self::Target>,
fn try_push<V>(&mut self, v: V) where
V: Into<Self::Target>,
Tries to push to a Value
if as an Array
.
This funciton will have no effect if Value
is of
a different type Read more
sourcefn pop(&mut self) -> Result<Option<Self::Target>, AccessError>
fn pop(&mut self) -> Result<Option<Self::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
Read more
sourcefn try_pop(&mut self) -> Option<Self::Target>
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 Read more
sourcefn get_mut<Q>(&mut self, k: &Q) -> Option<&mut Self::Target> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut Self::Target> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Same as get
but returns a mutable ref instead
sourcefn get_idx_mut(&mut self, i: usize) -> Option<&mut Self::Target>
fn get_idx_mut(&mut self, i: usize) -> Option<&mut Self::Target>
Same as get_idx
but returns a mutable ref instead
sourceimpl<K, T, S> PartialEq<HashMap<K, T, S>> for Value where
K: AsRef<str> + Hash + Eq,
Value: PartialEq<T>,
S: BuildHasher,
impl<K, T, S> PartialEq<HashMap<K, T, S>> for Value where
K: AsRef<str> + Hash + Eq,
Value: PartialEq<T>,
S: BuildHasher,
sourceimpl TryFrom<Value> for OwnedValue
impl TryFrom<Value> for OwnedValue
type Error = SerdeConversionError
type Error = SerdeConversionError
The type returned in the event of a conversion error.
sourcefn try_from(item: Value) -> Result<Self, SerdeConversionError>
fn try_from(item: Value) -> Result<Self, SerdeConversionError>
Performs the conversion.
sourceimpl TryInto<Value> for OwnedValue
impl TryInto<Value> for OwnedValue
type Error = SerdeConversionError
type Error = SerdeConversionError
The type returned in the event of a conversion error.
sourcefn try_into(self) -> Result<Value, SerdeConversionError>
fn try_into(self) -> Result<Value, SerdeConversionError>
Performs the conversion.
sourceimpl Value for Value
impl Value for Value
sourcefn is_integer(&self) -> bool
fn is_integer(&self) -> bool
returns true if the current value a integer number
sourcefn is_f64_castable(&self) -> bool
fn is_f64_castable(&self) -> bool
returns true if the current value can be cast into a f64
sourceimpl ValueAccess for Value
impl ValueAccess for Value
sourcefn value_type(&self) -> ValueType
fn value_type(&self) -> ValueType
Gets the type of the current value
sourcefn cast_f64(&self) -> Option<f64>
fn cast_f64(&self) -> Option<f64>
Casts the current value to a f64 if possible, this will turn integer values into floats. Read more
sourcefn as_array(&self) -> Option<&Vec<Self>>
fn as_array(&self) -> Option<&Vec<Self>>
Tries to represent the value as an array and returns a refference to it
sourcefn as_object(&self) -> Option<&HashMap<Self::Key, Self>>
fn as_object(&self) -> Option<&HashMap<Self::Key, Self>>
Tries to represent the value as an object and returns a refference to it
sourcefn try_as_bool(&self) -> Result<bool, TryTypeError>
fn try_as_bool(&self) -> Result<bool, TryTypeError>
Tries to represent the value as a bool Read more
sourcefn try_as_i128(&self) -> Result<i128, TryTypeError>
fn try_as_i128(&self) -> Result<i128, TryTypeError>
Tries to represent the value as a i128 Read more
sourcefn try_as_i64(&self) -> Result<i64, TryTypeError>
fn try_as_i64(&self) -> Result<i64, TryTypeError>
Tries to represent the value as an i64 Read more
sourcefn try_as_i32(&self) -> Result<i32, TryTypeError>
fn try_as_i32(&self) -> Result<i32, TryTypeError>
Tries to represent the value as an i32 Read more
sourcefn try_as_i16(&self) -> Result<i16, TryTypeError>
fn try_as_i16(&self) -> Result<i16, TryTypeError>
Tries to represent the value as an i16 Read more
sourcefn try_as_i8(&self) -> Result<i8, TryTypeError>
fn try_as_i8(&self) -> Result<i8, TryTypeError>
Tries to represent the value as an i8 Read more
sourcefn try_as_u128(&self) -> Result<u128, TryTypeError>
fn try_as_u128(&self) -> Result<u128, TryTypeError>
Tries to represent the value as an u128 Read more
sourcefn try_as_u64(&self) -> Result<u64, TryTypeError>
fn try_as_u64(&self) -> Result<u64, TryTypeError>
Tries to represent the value as an u64 Read more
sourcefn try_as_usize(&self) -> Result<usize, TryTypeError>
fn try_as_usize(&self) -> Result<usize, TryTypeError>
Tries to represent the value as an usize Read more
sourcefn try_as_u32(&self) -> Result<u32, TryTypeError>
fn try_as_u32(&self) -> Result<u32, TryTypeError>
Tries to represent the value as an u32 Read more
sourcefn try_as_u16(&self) -> Result<u16, TryTypeError>
fn try_as_u16(&self) -> Result<u16, TryTypeError>
Tries to represent the value as an u16 Read more
sourcefn try_as_u8(&self) -> Result<u8, TryTypeError>
fn try_as_u8(&self) -> Result<u8, TryTypeError>
Tries to represent the value as an u8 Read more
sourcefn try_as_f64(&self) -> Result<f64, TryTypeError>
fn try_as_f64(&self) -> Result<f64, TryTypeError>
Tries to represent the value as a f64 Read more
sourcefn try_cast_f64(&self) -> Result<f64, TryTypeError>
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
sourcefn try_as_f32(&self) -> Result<f32, TryTypeError>
fn try_as_f32(&self) -> Result<f32, TryTypeError>
Tries to represent the value as a f32 Read more
sourcefn try_as_str(&self) -> Result<&str, TryTypeError>
fn try_as_str(&self) -> Result<&str, TryTypeError>
Tries to represent the value as a &str Read more
sourcefn try_as_char(&self) -> Result<char, TryTypeError>
fn try_as_char(&self) -> Result<char, TryTypeError>
Tries to represent the value as a Char Read more
sourcefn try_as_array(&self) -> Result<&Self::Array, TryTypeError>
fn try_as_array(&self) -> Result<&Self::Array, TryTypeError>
Tries to represent the value as an array and returns a refference to it Read more
sourcefn try_as_object(&self) -> Result<&Self::Object, TryTypeError>
fn try_as_object(&self) -> Result<&Self::Object, TryTypeError>
Tries to represent the value as an object and returns a refference to it Read more
sourcefn get<Q>(&self, k: &Q) -> Option<&Self::Target> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get<Q>(&self, k: &Q) -> Option<&Self::Target> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
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. Read more
sourcefn try_get<Q>(&self, k: &Q) -> Result<Option<&Self::Target>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get<Q>(&self, k: &Q) -> Result<Option<&Self::Target>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Trys 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
sourcefn contains_key<Q>(&self, k: &Q) -> bool where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn contains_key<Q>(&self, k: &Q) -> bool where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Checks if a Value contains a given key. This will return flase if Value isn’t an object Read more
sourcefn get_idx(&self, i: usize) -> Option<&Self::Target>
fn get_idx(&self, i: usize) -> Option<&Self::Target>
Gets a ref to a value based on n index, returns None
if the
current Value isn’t an Array or doesn’t contain the index
it was asked for. Read more
sourcefn try_get_idx(&self, i: usize) -> Result<Option<&Self::Target>, TryTypeError>
fn try_get_idx(&self, i: usize) -> Result<Option<&Self::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 bouds Read more
sourcefn get_bool<Q>(&self, k: &Q) -> Option<bool> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_bool<Q>(&self, k: &Q) -> Option<bool> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a bool
sourcefn try_get_bool<Q>(&self, k: &Q) -> Result<Option<bool>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_bool<Q>(&self, k: &Q) -> Result<Option<bool>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a bool, returns an error if it isn’t bool Read more
sourcefn get_i128<Q>(&self, k: &Q) -> Option<i128> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_i128<Q>(&self, k: &Q) -> Option<i128> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i128
sourcefn try_get_i128<Q>(&self, k: &Q) -> Result<Option<i128>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_i128<Q>(&self, k: &Q) -> Result<Option<i128>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i128, returns an error if it isn’t i128 Read more
sourcefn get_i64<Q>(&self, k: &Q) -> Option<i64> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_i64<Q>(&self, k: &Q) -> Option<i64> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i64
sourcefn try_get_i64<Q>(&self, k: &Q) -> Result<Option<i64>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_i64<Q>(&self, k: &Q) -> Result<Option<i64>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i64, returns an error if it isn’t a i64 Read more
sourcefn get_i32<Q>(&self, k: &Q) -> Option<i32> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_i32<Q>(&self, k: &Q) -> Option<i32> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i32
sourcefn try_get_i32<Q>(&self, k: &Q) -> Result<Option<i32>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_i32<Q>(&self, k: &Q) -> Result<Option<i32>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i32, returns an error if it isn’t a i32 Read more
sourcefn get_i16<Q>(&self, k: &Q) -> Option<i16> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_i16<Q>(&self, k: &Q) -> Option<i16> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i16
sourcefn try_get_i16<Q>(&self, k: &Q) -> Result<Option<i16>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_i16<Q>(&self, k: &Q) -> Result<Option<i16>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i16, returns an error if it isn’t a i16 Read more
sourcefn get_i8<Q>(&self, k: &Q) -> Option<i8> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_i8<Q>(&self, k: &Q) -> Option<i8> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i8
sourcefn try_get_i8<Q>(&self, k: &Q) -> Result<Option<i8>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_i8<Q>(&self, k: &Q) -> Result<Option<i8>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a i8, returns an error if it isn’t a i8 Read more
sourcefn get_u128<Q>(&self, k: &Q) -> Option<u128> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_u128<Q>(&self, k: &Q) -> Option<u128> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u128
sourcefn try_get_u128<Q>(&self, k: &Q) -> Result<Option<u128>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_u128<Q>(&self, k: &Q) -> Result<Option<u128>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u128, returns an error if it isn’t a u128 Read more
sourcefn get_u64<Q>(&self, k: &Q) -> Option<u64> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_u64<Q>(&self, k: &Q) -> Option<u64> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u64
sourcefn try_get_u64<Q>(&self, k: &Q) -> Result<Option<u64>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_u64<Q>(&self, k: &Q) -> Result<Option<u64>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u64, returns an error if it isn’t a u64 Read more
sourcefn get_usize<Q>(&self, k: &Q) -> Option<usize> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_usize<Q>(&self, k: &Q) -> Option<usize> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a usize
sourcefn try_get_usize<Q>(&self, k: &Q) -> Result<Option<usize>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_usize<Q>(&self, k: &Q) -> Result<Option<usize>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a usize, returns an error if it isn’t a usize Read more
sourcefn get_u32<Q>(&self, k: &Q) -> Option<u32> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_u32<Q>(&self, k: &Q) -> Option<u32> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u32
sourcefn try_get_u32<Q>(&self, k: &Q) -> Result<Option<u32>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_u32<Q>(&self, k: &Q) -> Result<Option<u32>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u32, returns an error if it isn’t a u32 Read more
sourcefn get_u16<Q>(&self, k: &Q) -> Option<u16> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_u16<Q>(&self, k: &Q) -> Option<u16> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u16
sourcefn try_get_u16<Q>(&self, k: &Q) -> Result<Option<u16>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_u16<Q>(&self, k: &Q) -> Result<Option<u16>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u16, returns an error if it isn’t a u16 Read more
sourcefn get_u8<Q>(&self, k: &Q) -> Option<u8> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_u8<Q>(&self, k: &Q) -> Option<u8> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u8
sourcefn try_get_u8<Q>(&self, k: &Q) -> Result<Option<u8>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_u8<Q>(&self, k: &Q) -> Result<Option<u8>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u8, returns an error if it isn’t a u8 Read more
sourcefn get_f64<Q>(&self, k: &Q) -> Option<f64> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_f64<Q>(&self, k: &Q) -> Option<f64> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a f64
sourcefn try_get_f64<Q>(&self, k: &Q) -> Result<Option<f64>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_f64<Q>(&self, k: &Q) -> Result<Option<f64>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a u8, returns an error if it isn’t a u8 Read more
sourcefn get_f32<Q>(&self, k: &Q) -> Option<f32> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_f32<Q>(&self, k: &Q) -> Option<f32> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a f32
sourcefn try_get_f32<Q>(&self, k: &Q) -> Result<Option<f32>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_f32<Q>(&self, k: &Q) -> Result<Option<f32>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a f32, returns an error if it isn’t a f32 Read more
sourcefn get_str<Q>(&self, k: &Q) -> Option<&str> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_str<Q>(&self, k: &Q) -> Option<&str> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a str
sourcefn try_get_str<Q>(&self, k: &Q) -> Result<Option<&str>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_str<Q>(&self, k: &Q) -> Result<Option<&str>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a str, returns an error if it isn’t a str Read more
sourcefn get_array<Q>(&self, k: &Q) -> Option<&<Self::Target as ValueAccess>::Array> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_array<Q>(&self, k: &Q) -> Option<&<Self::Target as ValueAccess>::Array> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a array
sourcefn try_get_array<Q>(
&self,
k: &Q
) -> Result<Option<&<Self::Target as ValueAccess>::Array>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_array<Q>(
&self,
k: &Q
) -> Result<Option<&<Self::Target as ValueAccess>::Array>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as an array, returns an error if it isn’t a array Read more
sourcefn get_object<Q>(&self, k: &Q) -> Option<&<Self::Target as ValueAccess>::Object> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn get_object<Q>(&self, k: &Q) -> Option<&<Self::Target as ValueAccess>::Object> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as a object
sourcefn try_get_object<Q>(
&self,
k: &Q
) -> Result<Option<&<Self::Target as ValueAccess>::Object>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
fn try_get_object<Q>(
&self,
k: &Q
) -> Result<Option<&<Self::Target as ValueAccess>::Object>, TryTypeError> where
Q: Hash + Eq + Ord + ?Sized,
Self::Key: Borrow<Q>,
Self::Key: Hash,
Self::Key: Eq,
Tries to get an element of an object as an object, returns an error if it isn’t an object Read more
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more