Enum simd_json::value::owned::Value[][src]

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)
Expand description

Static values

String(String)
Expand description

string type

Array(Vec<Value>)
Expand description

array type

Object(Box<Object>)
Expand description

object type

Trait Implementations

impl<'input> Builder<'input> for Value[src]

#[must_use]
fn null() -> Self
[src]

Returns anull value

#[must_use]
fn array_with_capacity(capacity: usize) -> Self
[src]

Returns an empty array with a given capacity

#[must_use]
fn object_with_capacity(capacity: usize) -> Self
[src]

Returns an empty object with a given capacity

#[must_use]
fn array() -> Self
[src]

Returns an empty array

#[must_use]
fn object() -> Self
[src]

Returns an empty object

impl Clone for Value[src]

fn clone(&self) -> Value[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Value[src]

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

Formats the value using the given formatter. Read more

impl Default for Value[src]

#[must_use]
fn default() -> Self
[src]

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

impl<'de> Deserialize<'de> for Value[src]

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
    D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl<'de> Deserializer<'de> for Value[src]

type Error = Error

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

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

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

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

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

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

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

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

Hint that the Deserialize type is expecting a bool value.

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

Hint that the Deserialize type is expecting an i8 value.

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

Hint that the Deserialize type is expecting an i16 value.

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

Hint that the Deserialize type is expecting an i32 value.

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

Hint that the Deserialize type is expecting an i64 value.

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

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

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

Hint that the Deserialize type is expecting a u8 value.

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

Hint that the Deserialize type is expecting a u16 value.

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

Hint that the Deserialize type is expecting a u32 value.

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

Hint that the Deserialize type is expecting a u64 value.

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

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

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

Hint that the Deserialize type is expecting a f32 value.

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

Hint that the Deserialize type is expecting a f64 value.

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

Hint that the Deserialize type is expecting a char value.

fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

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

Hint that the Deserialize type is expecting a unit value.

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

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

fn deserialize_newtype_struct<V>(
    self,
    name: &'static str,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

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

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

fn deserialize_tuple<V>(
    self,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

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

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

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

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

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

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

fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn is_human_readable(&self) -> bool[src]

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

impl<'de> Deserializer<'de> for &'de Value[src]

type Error = Error

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

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

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

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

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

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

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

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

Hint that the Deserialize type is expecting a bool value.

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

Hint that the Deserialize type is expecting an i8 value.

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

Hint that the Deserialize type is expecting an i16 value.

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

Hint that the Deserialize type is expecting an i32 value.

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

Hint that the Deserialize type is expecting an i64 value.

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

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

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

Hint that the Deserialize type is expecting a u8 value.

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

Hint that the Deserialize type is expecting a u16 value.

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

Hint that the Deserialize type is expecting a u32 value.

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

Hint that the Deserialize type is expecting a u64 value.

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

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

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

Hint that the Deserialize type is expecting a f32 value.

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

Hint that the Deserialize type is expecting a f64 value.

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

Hint that the Deserialize type is expecting a char value.

fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

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

Hint that the Deserialize type is expecting a unit value.

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

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

fn deserialize_newtype_struct<V>(
    self,
    name: &'static str,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

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

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

fn deserialize_tuple<V>(
    self,
    len: usize,
    visitor: V
) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

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

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

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

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

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

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

fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
    V: Visitor<'de>, 
[src]

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

fn is_human_readable(&self) -> bool[src]

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

impl Display for Value[src]

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

Formats the value using the given formatter. Read more

impl From<&'_ String> for Value[src]

#[must_use]
fn from(s: &String) -> Self
[src]

Performs the conversion.

impl From<&'_ str> for Value[src]

#[must_use]
fn from(s: &str) -> Self
[src]

Performs the conversion.

impl From<()> for Value[src]

#[must_use]
fn from(_b: ()) -> Self
[src]

Performs the conversion.

impl<'value> From<Cow<'value, str>> for Value[src]

#[must_use]
fn from(c: Cow<'value, str>) -> Self
[src]

Performs the conversion.

impl From<HashMap<String, Value, RandomState>> for Value[src]

#[must_use]
fn from(v: Object) -> Self
[src]

Performs the conversion.

impl From<HashMap<String, Value, RandomState>> for Value[src]

#[must_use]
fn from(v: HashMap<String, Self>) -> Self
[src]

Performs the conversion.

impl<T> From<Option<T>> for Value where
    Value: From<T>, 
[src]

#[must_use]
fn from(s: Option<T>) -> Self
[src]

Performs the conversion.

impl From<StaticNode> for Value[src]

#[must_use]
fn from(s: StaticNode) -> Self
[src]

Performs the conversion.

impl From<String> for Value[src]

#[must_use]
fn from(s: String) -> Self
[src]

Performs the conversion.

impl From<Value<'_>> for Value[src]

#[must_use]
fn from(b: BorrowedValue<'_>) -> Self
[src]

Performs the conversion.

impl<'value> From<Value> for Value<'value>[src]

#[must_use]
fn from(b: OwnedValue) -> Self
[src]

Performs the conversion.

impl<S> From<Vec<S, Global>> for Value where
    Value: From<S>, 
[src]

#[must_use]
fn from(v: Vec<S>) -> Self
[src]

Performs the conversion.

impl From<bool> for Value[src]

#[must_use]
fn from(b: bool) -> Self
[src]

Performs the conversion.

impl From<f32> for Value[src]

#[must_use]
fn from(f: f32) -> Self
[src]

Performs the conversion.

impl From<f64> for Value[src]

#[must_use]
fn from(f: f64) -> Self
[src]

Performs the conversion.

impl From<i16> for Value[src]

#[must_use]
fn from(i: i16) -> Self
[src]

Performs the conversion.

impl From<i32> for Value[src]

#[must_use]
fn from(i: i32) -> Self
[src]

Performs the conversion.

impl From<i64> for Value[src]

#[must_use]
fn from(i: i64) -> Self
[src]

Performs the conversion.

impl From<i8> for Value[src]

#[must_use]
fn from(i: i8) -> Self
[src]

Performs the conversion.

impl From<u16> for Value[src]

#[must_use]
fn from(i: u16) -> Self
[src]

Performs the conversion.

impl From<u32> for Value[src]

#[must_use]
fn from(i: u32) -> Self
[src]

Performs the conversion.

impl From<u64> for Value[src]

#[must_use]
fn from(i: u64) -> Self
[src]

Performs the conversion.

impl From<u8> for Value[src]

#[must_use]
fn from(i: u8) -> Self
[src]

Performs the conversion.

impl From<usize> for Value[src]

#[must_use]
fn from(i: usize) -> Self
[src]

Performs the conversion.

impl<K: ToString, V: Into<Value>> FromIterator<(K, V)> for Value[src]

#[must_use]
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
[src]

Creates a value from an iterator. Read more

impl<V: Into<Value>> FromIterator<V> for Value[src]

#[must_use]
fn from_iter<I: IntoIterator<Item = V>>(iter: I) -> Self
[src]

Creates a value from an iterator. Read more

impl Index<&'_ str> for Value[src]

type Output = Self

The returned type after indexing.

#[must_use]
fn index(&self, index: &str) -> &Self::Output
[src]

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

impl Index<usize> for Value[src]

type Output = Self

The returned type after indexing.

#[must_use]
fn index(&self, index: usize) -> &Self::Output
[src]

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

impl IndexMut<&'_ str> for Value[src]

#[must_use]
fn index_mut(&mut self, index: &str) -> &mut Self::Output
[src]

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

impl IndexMut<usize> for Value[src]

#[must_use]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]

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

impl Mutable for Value[src]

#[must_use]
fn as_array_mut(&mut self) -> Option<&mut Vec<Self>>
[src]

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

#[must_use]
fn as_object_mut(&mut self) -> Option<&mut HashMap<Self::Key, Self>>
[src]

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

fn insert<K, V>(
    &mut self,
    k: K,
    v: V
) -> Result<Option<Self::Target>, AccessError> where
    V: Into<Self::Target>,
    K: Into<Self::Key>,
    Self::Key: Hash,
    Self::Key: Eq
[src]

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

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

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

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
[src]

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

fn 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
[src]

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

fn push<V>(&mut self, v: V) -> Result<(), AccessError> where
    V: Into<Self::Target>, 
[src]

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

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

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

fn pop(&mut self) -> Result<Option<Self::Target>, AccessError>[src]

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

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

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

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
[src]

Same as get but returns a mutable ref instead

fn get_idx_mut(&mut self, i: usize) -> Option<&mut Self::Target>[src]

Same as get_idx but returns a mutable ref instead

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

#[must_use]
fn eq(&self, other: &&[T]) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

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

#[must_use]
fn eq(&self, other: &&T) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<&'_ str> for Value[src]

#[must_use]
fn eq(&self, other: &&str) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<()> for Value[src]

#[must_use]
fn eq(&self, _other: &()) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

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

#[must_use]
fn eq(&self, other: &HashMap<K, T, S>) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<String> for Value[src]

#[must_use]
fn eq(&self, other: &String) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Value<'_>> for Value[src]

#[must_use]
fn eq(&self, other: &BorrowedValue<'_>) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl<'value> PartialEq<Value> for Value<'value>[src]

#[must_use]
fn eq(&self, other: &OwnedValue) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<Value> for Value[src]

#[must_use]
fn eq(&self, other: &Self) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<bool> for Value[src]

#[must_use]
fn eq(&self, other: &bool) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<f32> for Value[src]

#[must_use]
fn eq(&self, other: &f32) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<f64> for Value[src]

#[must_use]
fn eq(&self, other: &f64) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<i128> for Value[src]

#[must_use]
fn eq(&self, other: &i128) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<i16> for Value[src]

#[must_use]
fn eq(&self, other: &i16) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<i32> for Value[src]

#[must_use]
fn eq(&self, other: &i32) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<i64> for Value[src]

#[must_use]
fn eq(&self, other: &i64) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<i8> for Value[src]

#[must_use]
fn eq(&self, other: &i8) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<str> for Value[src]

#[must_use]
fn eq(&self, other: &str) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<u128> for Value[src]

#[must_use]
fn eq(&self, other: &u128) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<u16> for Value[src]

#[must_use]
fn eq(&self, other: &u16) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<u32> for Value[src]

#[must_use]
fn eq(&self, other: &u32) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<u64> for Value[src]

#[must_use]
fn eq(&self, other: &u64) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<u8> for Value[src]

#[must_use]
fn eq(&self, other: &u8) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialEq<usize> for Value[src]

#[must_use]
fn eq(&self, other: &usize) -> bool
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Serialize for Value[src]

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

Serialize this value into the given Serde serializer. Read more

impl TryFrom<Value> for OwnedValue[src]

type Error = SerdeConversionError

The type returned in the event of a conversion error.

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

Performs the conversion.

impl TryInto<Value> for OwnedValue[src]

type Error = SerdeConversionError

The type returned in the event of a conversion error.

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

Performs the conversion.

impl Value for Value[src]

#[must_use]
fn value_type(&self) -> ValueType
[src]

Returns the type of the current Valye

#[must_use]
fn is_null(&self) -> bool
[src]

returns true if the current value is null

#[must_use]
fn is_float(&self) -> bool
[src]

returns true if the current value a floatingpoint number

#[must_use]
fn is_integer(&self) -> bool
[src]

returns true if the current value a integer number

#[must_use]
fn is_number(&self) -> bool
[src]

returns true if the current value a number either float or integer

#[must_use]
fn is_bool(&self) -> bool
[src]

returns true if the current value a bool

#[must_use]
fn is_i128(&self) -> bool
[src]

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

#[must_use]
fn is_i64(&self) -> bool
[src]

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

#[must_use]
fn is_i32(&self) -> bool
[src]

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

#[must_use]
fn is_i16(&self) -> bool
[src]

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

#[must_use]
fn is_i8(&self) -> bool
[src]

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

#[must_use]
fn is_u128(&self) -> bool
[src]

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

#[must_use]
fn is_u64(&self) -> bool
[src]

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

#[must_use]
fn is_usize(&self) -> bool
[src]

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

#[must_use]
fn is_u32(&self) -> bool
[src]

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

#[must_use]
fn is_u16(&self) -> bool
[src]

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

#[must_use]
fn is_u8(&self) -> bool
[src]

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

#[must_use]
fn is_f64(&self) -> bool
[src]

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

#[must_use]
fn is_f64_castable(&self) -> bool
[src]

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

#[must_use]
fn is_f32(&self) -> bool
[src]

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

#[must_use]
fn is_str(&self) -> bool
[src]

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

#[must_use]
fn is_char(&self) -> bool
[src]

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

#[must_use]
fn is_array(&self) -> bool
[src]

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

#[must_use]
fn is_object(&self) -> bool
[src]

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

impl ValueAccess for Value[src]

type Target = Value

The target for nested lookups

type Key = String

The type for Objects

type Array = Vec<Self>

The array structure

type Object = HashMap<Self::Key, Self>

The object structure

#[must_use]
fn as_bool(&self) -> Option<bool>
[src]

Tries to represent the value as a bool

#[must_use]
fn as_i64(&self) -> Option<i64>
[src]

Tries to represent the value as an i64

#[must_use]
fn as_i128(&self) -> Option<i128>
[src]

Tries to represent the value as an i128

#[must_use]
fn as_u64(&self) -> Option<u64>
[src]

Tries to represent the value as an u64

#[must_use]
fn as_f64(&self) -> Option<f64>
[src]

Tries to represent the value as a f64

#[must_use]
fn cast_f64(&self) -> Option<f64>
[src]

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

#[must_use]
fn as_str(&self) -> Option<&str>
[src]

Tries to represent the value as a &str

#[must_use]
fn as_array(&self) -> Option<&Vec<Self>>
[src]

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

#[must_use]
fn as_object(&self) -> Option<&HashMap<Self::Key, Self>>
[src]

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

#[must_use]
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
[src]

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

#[must_use]
fn contains_key<Q>(&self, k: &Q) -> bool where
    Q: Hash + Eq + Ord + ?Sized,
    Self::Key: Borrow<Q>,
    Self::Key: Hash,
    Self::Key: Eq
[src]

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

#[must_use]
fn get_idx(&self, i: usize) -> Option<&Self::Target>
[src]

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

#[must_use]
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
[src]

Tries to get an element of an object as a bool

#[must_use]
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
[src]

Tries to get an element of an object as a i128

#[must_use]
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
[src]

Tries to get an element of an object as a i64

#[must_use]
fn as_i32(&self) -> Option<i32>
[src]

Tries to represent the value as an i32

#[must_use]
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
[src]

Tries to get an element of an object as a i32

#[must_use]
fn as_i16(&self) -> Option<i16>
[src]

Tries to represent the value as an i16

#[must_use]
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
[src]

Tries to get an element of an object as a i16

#[must_use]
fn as_i8(&self) -> Option<i8>
[src]

Tries to represent the value as an i8

#[must_use]
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
[src]

Tries to get an element of an object as a i8

#[must_use]
fn as_u128(&self) -> Option<u128>
[src]

Tries to represent the value as an u128

#[must_use]
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
[src]

Tries to get an element of an object as a u128

#[must_use]
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
[src]

Tries to get an element of an object as a u64

#[must_use]
fn as_usize(&self) -> Option<usize>
[src]

Tries to represent the value as an usize

#[must_use]
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
[src]

Tries to get an element of an object as a usize

#[must_use]
fn as_u32(&self) -> Option<u32>
[src]

Tries to represent the value as an u32

#[must_use]
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
[src]

Tries to get an element of an object as a u32

#[must_use]
fn as_u16(&self) -> Option<u16>
[src]

Tries to represent the value as an u16

#[must_use]
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
[src]

Tries to get an element of an object as a u16

#[must_use]
fn as_u8(&self) -> Option<u8>
[src]

Tries to represent the value as an u8

#[must_use]
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
[src]

Tries to get an element of an object as a u8

#[must_use]
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
[src]

Tries to get an element of an object as a f64

#[must_use]
fn as_f32(&self) -> Option<f32>
[src]

Tries to represent the value as a f32

#[must_use]
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
[src]

Tries to get an element of an object as a f32

#[must_use]
fn as_char(&self) -> Option<char>
[src]

Tries to represent the value as a Char

#[must_use]
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
[src]

Tries to get an element of an object as a str

#[must_use]
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
[src]

Tries to get an element of an object as a array

#[must_use]
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
[src]

Tries to get an element of an object as a object

impl Writable for Value[src]

fn encode(&self) -> String[src]

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

fn encode_pp(&self) -> String[src]

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

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

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

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

Encodes the value into it’s JSON representation into a Writer, pretty printed 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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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