Enum Value

Source
pub enum Value<'a> {
    Null,
    Bool(bool),
    I64(i64),
    F64(f64),
    Bytes(Box<Cow<'a, [u8]>>),
    String(Box<Cow<'a, str>>),
    List(Box<Cow<'a, List<'a>>>),
    Table(Box<Cow<'a, Table<'a>>>),
}
Expand description

Defines the types of data that can be stored in a table.

Variants§

§

Null

A type with a single value; also called nil or unit. Can be used to indicate presence of a key but absence of a significant value.

§

Bool(bool)

A type with two values, true and false.

§

I64(i64)

A signed 64-bit integer type.

§

F64(f64)

A floating-point type with 64-bit precision.

§

Bytes(Box<Cow<'a, [u8]>>)

A slice of bytes wrapped with a clone-on-write container.

§

String(Box<Cow<'a, str>>)

A UTF-8 string wrapped with a clone-on-write container.

§

List(Box<Cow<'a, List<'a>>>)

A nested list wrapped with a clone-on-write container.

§

Table(Box<Cow<'a, Table<'a>>>)

A nested table wrapped with a clone-on-write container.

Implementations§

Source§

impl<'a> Value<'a>

Source

pub fn serialize<T>(value: &T) -> Result<Value<'static>, Error>
where T: Serialize + ?Sized,

Serializes the given value into a Value.

§Examples
use table::Value;

assert_eq!(Value::serialize(&328), Ok(Value::I64(328)));
Source

pub fn deserialize<'b: 'a, T>(&'b self) -> Result<T, Error>
where T: Deserialize<'b>,

Deserializes the referenced Value into a value of another type.

§Examples
use table::Value;

assert_eq!(Value::Bool(false).deserialize(), Ok(false));
Source

pub fn deserialize_into<T>(self) -> Result<T, Error>
where T: Deserialize<'a>,

Deserializes the Value into a value of another type, consuming the Value and taking ownership to avoid copying buffers.

§Examples
use table::Value;

assert_eq!(Value::Null.deserialize_into(), Ok(()));

Trait Implementations§

Source§

impl<'a> AsMut<Value<'a>> for Value<'a>

Source§

fn as_mut(&mut self) -> &mut Value<'a>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<'a> AsRef<Value<'a>> for Value<'a>

Source§

fn as_ref(&self) -> &Value<'a>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Clone for Value<'a>

Source§

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

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

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Value<'a>

Source§

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

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

impl<'a> Default for Value<'a>

Source§

fn default() -> Self

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

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

Source§

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

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

impl<'de: 'a, 'a> Deserializer<'de> for &'de Value<'a>

Source§

type Error = Error

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fn deserialize_enum<V>( self, _name: &'static str, _variants: &'static [&'static str], visitor: V, ) -> Result<V::Value, Self::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_i128<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Self::Error>
where V: Visitor<'de>,

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

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

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

fn is_human_readable(&self) -> bool

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

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

Source§

type Error = Error

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fn deserialize_enum<V>( self, _name: &'static str, _variants: &'static [&'static str], visitor: V, ) -> Result<V::Value, Self::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_i128<V>( self, visitor: V, ) -> Result<<V as Visitor<'de>>::Value, Self::Error>
where V: Visitor<'de>,

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

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

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

fn is_human_readable(&self) -> bool

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

impl<'a> From<&'a [u8]> for Value<'a>

Source§

fn from(value: &'a [u8]) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a List<'a>> for Value<'a>

Source§

fn from(value: &'a List<'a>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a Table<'a>> for Value<'a>

Source§

fn from(value: &'a Table<'a>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a, 'b> From<&'b Value<'a>> for Unexpected<'b>

Source§

fn from(value: &'b Value<'a>) -> Unexpected<'b>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: &'a str) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Box<Cow<'a, [u8]>>> for Value<'a>

Source§

fn from(value: Box<Cow<'a, [u8]>>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Box<Cow<'a, List<'a>>>> for Value<'a>

Source§

fn from(value: Box<Cow<'a, List<'a>>>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Box<Cow<'a, Table<'a>>>> for Value<'a>

Source§

fn from(value: Box<Cow<'a, Table<'a>>>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Box<Cow<'a, str>>> for Value<'a>

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<Cow<'a, [u8]>> for Value<'a>

Source§

fn from(value: Cow<'a, [u8]>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Cow<'a, List<'a>>> for Value<'a>

Source§

fn from(value: Cow<'a, List<'a>>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Cow<'a, Table<'a>>> for Value<'a>

Source§

fn from(value: Cow<'a, Table<'a>>) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<List<'a>> for Value<'a>

Source§

fn from(value: List<'a>) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: String) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Table<'a>> for Value<'a>

Source§

fn from(value: Table<'a>) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Vec<u8>> for Value<'a>

Source§

fn from(value: Vec<u8>) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: bool) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: f32) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: f64) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: i16) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: i32) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: i64) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: i8) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> From<isize> for Value<'a>

Source§

fn from(value: isize) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: u16) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: u32) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: u64) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: u8) -> Value<'a>

Converts to this type from the input type.
Source§

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

Source§

fn from(value: usize) -> Value<'a>

Converts to this type from the input type.
Source§

impl<'a> PartialEq for Value<'a>

Source§

fn eq(&self, other: &Value<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialOrd for Value<'a>

Source§

fn partial_cmp(&self, other: &Value<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> Serialize for Value<'a>

Source§

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

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

impl<'a> TryAsMut<Box<Cow<'a, [u8]>>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, [u8]>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Box<Cow<'a, List<'a>>>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, List<'a>>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Box<Cow<'a, Table<'a>>>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, Table<'a>>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Box<Cow<'a, str>>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, str>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Cow<'a, [u8]>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Cow<'a, [u8]>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Cow<'a, List<'a>>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Cow<'a, List<'a>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Cow<'a, Table<'a>>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Cow<'a, Table<'a>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Cow<'a, str>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Cow<'a, str>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<List<'a>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut List<'a>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<String> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut String>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Table<'a>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Table<'a>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<Vec<u8>> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut Vec<u8>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<bool> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut bool>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<f64> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut f64>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsMut<i64> for Value<'a>

Source§

fn try_as_mut(&mut self) -> Option<&mut i64>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<[u8]> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&[u8]>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Box<Cow<'a, [u8]>>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Box<Cow<'a, [u8]>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Box<Cow<'a, List<'a>>>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Box<Cow<'a, List<'a>>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Box<Cow<'a, Table<'a>>>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Box<Cow<'a, Table<'a>>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Box<Cow<'a, str>>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Box<Cow<'a, str>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Cow<'a, [u8]>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Cow<'a, [u8]>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Cow<'a, List<'a>>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Cow<'a, List<'a>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Cow<'a, Table<'a>>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Cow<'a, Table<'a>>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Cow<'a, str>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Cow<'a, str>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<List<'a>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&List<'a>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<Table<'a>> for Value<'a>

Source§

fn try_as_ref(&self) -> Option<&Table<'a>>

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<bool> for Value<'a>

Source§

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

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<f64> for Value<'a>

Source§

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

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<i64> for Value<'a>

Source§

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

Attempt to unwrap the inner reference.
Source§

impl<'a> TryAsRef<str> for Value<'a>

Source§

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

Attempt to unwrap the inner reference.
Source§

impl<'de: 'a, 'a> VariantAccess<'de> for &'de Value<'a>

Source§

type Error = Error

The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess.
Source§

fn unit_variant(self) -> Result<(), Self::Error>

Called when deserializing a variant with no values. Read more
Source§

fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error>
where T: DeserializeSeed<'de>,

Called when deserializing a variant with a single value. Read more
Source§

fn tuple_variant<V>( self, _len: usize, visitor: V, ) -> Result<V::Value, Self::Error>
where V: Visitor<'de>,

Called when deserializing a tuple-like variant. Read more
Source§

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

Called when deserializing a struct-like variant. Read more
Source§

fn newtype_variant<T>(self) -> Result<T, Self::Error>
where T: Deserialize<'de>,

Called when deserializing a variant with a single value. Read more
Source§

impl<'de> VariantAccess<'de> for Value<'de>

Source§

type Error = Error

The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess.
Source§

fn unit_variant(self) -> Result<(), Self::Error>

Called when deserializing a variant with no values. Read more
Source§

fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error>
where T: DeserializeSeed<'de>,

Called when deserializing a variant with a single value. Read more
Source§

fn tuple_variant<V>( self, _len: usize, visitor: V, ) -> Result<V::Value, Self::Error>
where V: Visitor<'de>,

Called when deserializing a tuple-like variant. Read more
Source§

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

Called when deserializing a struct-like variant. Read more
Source§

fn newtype_variant<T>(self) -> Result<T, Self::Error>
where T: Deserialize<'de>,

Called when deserializing a variant with a single value. Read more
Source§

impl<'a> StructuralPartialEq for Value<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Value<'a>

§

impl<'a> RefUnwindSafe for Value<'a>

§

impl<'a> Send for Value<'a>

§

impl<'a> Sync for Value<'a>

§

impl<'a> Unpin for Value<'a>

§

impl<'a> UnwindSafe for Value<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

impl<T, U> TryAsMut<U> for T
where T: AsMut<U>,

Source§

fn try_as_mut(&mut self) -> Option<&mut U>

Attempt to unwrap the inner reference.
Source§

impl<T, U> TryAsRef<U> for T
where T: AsRef<U>,

Source§

fn try_as_ref(&self) -> Option<&U>

Attempt to unwrap the inner reference.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

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

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

Performs the conversion.