pub enum Value {
Static(StaticNode),
String(String),
Array(Vec<Value>),
Object(Box<Object>),
}
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§
source§impl<'input> Builder<'input> for Value
impl<'input> Builder<'input> for Value
source§fn array_with_capacity(capacity: usize) -> Self
fn array_with_capacity(capacity: usize) -> Self
Returns an empty array with a given capacity
source§fn object_with_capacity(capacity: usize) -> Self
fn object_with_capacity(capacity: usize) -> Self
Returns an empty object with a given capacity
source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
source§fn 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
source§impl<'de> Deserializer<'de> for &'de Value
impl<'de> Deserializer<'de> for &'de Value
source§fn 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 moresource§fn 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 moresource§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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>,
source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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>,
source§fn 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.source§fn 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.source§fn 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.source§fn 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 moresource§fn 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 moresource§fn 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 moresource§fn 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 moresource§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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 moresource§fn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether
Deserialize
implementations should expect to
deserialize their human-readable form. Read moresource§impl<'de> Deserializer<'de> for Value
impl<'de> Deserializer<'de> for Value
source§fn 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 moresource§fn 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 moresource§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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>,
source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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>,
source§fn 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.source§fn 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.source§fn 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.source§fn 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 moresource§fn 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 moresource§fn 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 moresource§fn 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 moresource§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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.source§fn 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 moresource§fn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether
Deserialize
implementations should expect to
deserialize their human-readable form. Read moresource§impl From<SizedHashMap<String, Value, BuildHasherDefault<AHasher>, 32>> for Value
impl From<SizedHashMap<String, Value, BuildHasherDefault<AHasher>, 32>> for Value
source§impl From<StaticNode> for Value
impl From<StaticNode> for Value
source§fn from(s: StaticNode) -> Self
fn from(s: StaticNode) -> Self
Converts to this type from the input type.
source§impl From<Value<'_>> for Value
impl From<Value<'_>> for Value
source§fn from(b: BorrowedValue<'_>) -> Self
fn from(b: BorrowedValue<'_>) -> Self
Converts to this type from the input type.
source§impl<'value> From<Value> for Value<'value>
impl<'value> From<Value> for Value<'value>
source§fn from(b: OwnedValue) -> Self
fn from(b: OwnedValue) -> Self
Converts to this type from the input type.
source§impl<V: Into<Value>> FromIterator<V> for Value
impl<V: Into<Value>> FromIterator<V> for Value
source§fn 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
source§impl<'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.
source§fn into_deserializer(self) -> Self::Deserializer
fn into_deserializer(self) -> Self::Deserializer
Convert this value into a deserializer.
source§impl Mutable for Value
impl Mutable for Value
source§fn 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
source§fn as_object_mut(&mut self) -> Option<&mut Object>
fn as_object_mut(&mut self) -> Option<&mut Object>
Tries to represent the value as an object and returns a mutable refference to it
source§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 + 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 + 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 moresource§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 + 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 + 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.source§fn remove<Q>(&mut self, k: &Q) -> Result<Option<Self::Target>, AccessError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn remove<Q>(&mut self, k: &Q) -> Result<Option<Self::Target>, AccessError>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Remove from this
Value
as an Object
.
Will return an AccessError::NotAnObject
if called
on a Value
that isn’t an object - otherwise will
behave the same as HashMap::remove
Read moresource§fn try_remove<Q>(&mut self, k: &Q) -> Option<Self::Target>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_remove<Q>(&mut self, k: &Q) -> Option<Self::Target>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to remove from this
Value
as an Object
.
If the Value
isn’t an object this opoeration will
return None
and have no effect.source§fn 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 moresource§fn 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 typesource§fn 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 moresource§fn 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 returnedsource§impl<T> PartialEq<&[T]> for Valuewhere
Value: PartialEq<T>,
impl<T> PartialEq<&[T]> for Valuewhere Value: PartialEq<T>,
source§impl PartialEq<&str> for Value
impl PartialEq<&str> for Value
source§impl<K, T, S> PartialEq<HashMap<K, T, S>> for Valuewhere
K: AsRef<str> + Hash + Eq,
Value: PartialEq<T>,
S: BuildHasher,
impl<K, T, S> PartialEq<HashMap<K, T, S>> for Valuewhere K: AsRef<str> + Hash + Eq, Value: PartialEq<T>, S: BuildHasher,
source§impl PartialEq<String> for Value
impl PartialEq<String> for Value
source§impl PartialEq<Value<'_>> for Value
impl PartialEq<Value<'_>> for Value
source§fn eq(&self, other: &BorrowedValue<'_>) -> bool
fn eq(&self, other: &BorrowedValue<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl<'value> PartialEq<Value> for Value<'value>
impl<'value> PartialEq<Value> for Value<'value>
source§fn eq(&self, other: &OwnedValue) -> bool
fn eq(&self, other: &OwnedValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<bool> for Value
impl PartialEq<bool> for Value
source§impl PartialEq<i128> for Value
impl PartialEq<i128> for Value
source§impl PartialEq<u128> for Value
impl PartialEq<u128> for Value
source§impl PartialEq<usize> for Value
impl PartialEq<usize> for Value
source§impl 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.
source§impl 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.
source§impl Value for Value
impl Value for Value
source§impl ValueAccess for Value
impl ValueAccess for Value
§type Object = SizedHashMap<String, Value, BuildHasherDefault<AHasher>, 32>
type Object = SizedHashMap<String, Value, BuildHasherDefault<AHasher>, 32>
The object structure
source§fn value_type(&self) -> ValueType
fn value_type(&self) -> ValueType
Gets the type of the current value
source§fn 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.
source§fn 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
source§fn as_object(&self) -> Option<&Object>
fn as_object(&self) -> Option<&Object>
Tries to represent the value as an object and returns a refference to it
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§fn get<Q>(&self, k: &Q) -> Option<&Self::Target>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get<Q>(&self, k: &Q) -> Option<&Self::Target>where Self::Key: Borrow<Q> + Hash + Eq, 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 try_get<Q>(&self, k: &Q) -> Result<Option<&Self::Target>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get<Q>(&self, k: &Q) -> Result<Option<&Self::Target>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
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 moresource§fn contains_key<Q>(&self, k: &Q) -> boolwhere
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn contains_key<Q>(&self, k: &Q) -> boolwhere Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Checks if a Value contains a given key. This will return
flase if Value isn’t an object
source§fn 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.source§fn 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 moresource§fn get_bool<Q>(&self, k: &Q) -> Option<bool>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_bool<Q>(&self, k: &Q) -> Option<bool>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a bool
source§fn try_get_bool<Q>(&self, k: &Q) -> Result<Option<bool>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_bool<Q>(&self, k: &Q) -> Result<Option<bool>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_i128<Q>(&self, k: &Q) -> Option<i128>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_i128<Q>(&self, k: &Q) -> Option<i128>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a i128
source§fn try_get_i128<Q>(&self, k: &Q) -> Result<Option<i128>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_i128<Q>(&self, k: &Q) -> Result<Option<i128>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_i64<Q>(&self, k: &Q) -> Option<i64>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_i64<Q>(&self, k: &Q) -> Option<i64>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a i64
source§fn try_get_i64<Q>(&self, k: &Q) -> Result<Option<i64>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_i64<Q>(&self, k: &Q) -> Result<Option<i64>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_i32<Q>(&self, k: &Q) -> Option<i32>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_i32<Q>(&self, k: &Q) -> Option<i32>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a i32
source§fn try_get_i32<Q>(&self, k: &Q) -> Result<Option<i32>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_i32<Q>(&self, k: &Q) -> Result<Option<i32>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_i16<Q>(&self, k: &Q) -> Option<i16>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_i16<Q>(&self, k: &Q) -> Option<i16>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a i16
source§fn try_get_i16<Q>(&self, k: &Q) -> Result<Option<i16>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_i16<Q>(&self, k: &Q) -> Result<Option<i16>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_i8<Q>(&self, k: &Q) -> Option<i8>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_i8<Q>(&self, k: &Q) -> Option<i8>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a i8
source§fn try_get_i8<Q>(&self, k: &Q) -> Result<Option<i8>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_i8<Q>(&self, k: &Q) -> Result<Option<i8>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_u128<Q>(&self, k: &Q) -> Option<u128>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_u128<Q>(&self, k: &Q) -> Option<u128>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a u128
source§fn try_get_u128<Q>(&self, k: &Q) -> Result<Option<u128>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_u128<Q>(&self, k: &Q) -> Result<Option<u128>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_u64<Q>(&self, k: &Q) -> Option<u64>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_u64<Q>(&self, k: &Q) -> Option<u64>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a u64
source§fn try_get_u64<Q>(&self, k: &Q) -> Result<Option<u64>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_u64<Q>(&self, k: &Q) -> Result<Option<u64>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_usize<Q>(&self, k: &Q) -> Option<usize>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_usize<Q>(&self, k: &Q) -> Option<usize>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a usize
source§fn try_get_usize<Q>(&self, k: &Q) -> Result<Option<usize>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_usize<Q>(&self, k: &Q) -> Result<Option<usize>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_u32<Q>(&self, k: &Q) -> Option<u32>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_u32<Q>(&self, k: &Q) -> Option<u32>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a u32
source§fn try_get_u32<Q>(&self, k: &Q) -> Result<Option<u32>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_u32<Q>(&self, k: &Q) -> Result<Option<u32>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_u16<Q>(&self, k: &Q) -> Option<u16>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_u16<Q>(&self, k: &Q) -> Option<u16>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a u16
source§fn try_get_u16<Q>(&self, k: &Q) -> Result<Option<u16>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_u16<Q>(&self, k: &Q) -> Result<Option<u16>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_u8<Q>(&self, k: &Q) -> Option<u8>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_u8<Q>(&self, k: &Q) -> Option<u8>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a u8
source§fn try_get_u8<Q>(&self, k: &Q) -> Result<Option<u8>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_u8<Q>(&self, k: &Q) -> Result<Option<u8>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_f64<Q>(&self, k: &Q) -> Option<f64>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_f64<Q>(&self, k: &Q) -> Option<f64>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a f64
source§fn try_get_f64<Q>(&self, k: &Q) -> Result<Option<f64>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_f64<Q>(&self, k: &Q) -> Result<Option<f64>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_f32<Q>(&self, k: &Q) -> Option<f32>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_f32<Q>(&self, k: &Q) -> Option<f32>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a f32
source§fn try_get_f32<Q>(&self, k: &Q) -> Result<Option<f32>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_f32<Q>(&self, k: &Q) -> Result<Option<f32>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 get_str<Q>(&self, k: &Q) -> Option<&str>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_str<Q>(&self, k: &Q) -> Option<&str>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a str
source§fn try_get_str<Q>(&self, k: &Q) -> Result<Option<&str>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_str<Q>(&self, k: &Q) -> Result<Option<&str>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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§fn get_array<Q>(&self, k: &Q) -> Option<&<Self::Target as ValueAccess>::Array>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn get_array<Q>(&self, k: &Q) -> Option<&<Self::Target as ValueAccess>::Array>where Self::Key: Borrow<Q> + Hash + Eq, Q: Hash + Eq + Ord + ?Sized,
Tries to get an element of an object as a array
source§fn try_get_array<Q>(
&self,
k: &Q
) -> Result<Option<&<Self::Target as ValueAccess>::Array>, TryTypeError>where
Self::Key: Borrow<Q> + Hash + Eq,
Q: Hash + Eq + Ord + ?Sized,
fn try_get_array<Q>( &self, k: &Q ) -> Result<Option<&<Self::Target as ValueAccess>::Array>, TryTypeError>where Self::Key: Borrow<Q> + Hash + Eq, 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 ValueInto for Value
impl ValueInto for Value
source§fn into_string(self) -> Option<<Value as ValueInto>::String>
fn into_string(self) -> Option<<Value as ValueInto>::String>
Tries to turn the value into it’s string representation
source§fn into_array(self) -> Option<<Value as ValueAccess>::Array>
fn into_array(self) -> Option<<Value as ValueAccess>::Array>
Tries to turn the value into it’s array representation
source§fn into_object(self) -> Option<<Value as ValueAccess>::Object>
fn into_object(self) -> Option<<Value as ValueAccess>::Object>
Tries to turn the value into it’s object representation
source§fn try_into_string(self) -> Result<Self::String, TryTypeError>
fn try_into_string(self) -> Result<Self::String, TryTypeError>
Tries to turn the value into it’s string representation Read more
source§fn try_into_array(self) -> Result<Self::Array, TryTypeError>
fn try_into_array(self) -> Result<Self::Array, TryTypeError>
Tries to turn the value into it’s array representation Read more
source§fn try_into_object(self) -> Result<Self::Object, TryTypeError>
fn try_into_object(self) -> Result<Self::Object, TryTypeError>
Tries to turn the value into it’s object representation 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more