Enum table::Value [−][src]
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>>>), }
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.
Methods
impl<'a> Value<'a>
[src]
impl<'a> Value<'a>
pub fn serialize<T: ?Sized>(value: &T) -> Result<Value<'static>, Error> where
T: Serialize,
[src]
pub fn serialize<T: ?Sized>(value: &T) -> Result<Value<'static>, Error> where
T: Serialize,
Serializes the given value into a Value
.
Examples
use table::Value; assert_eq!(Value::serialize(&328), Ok(Value::I64(328)));
pub fn deserialize<'b: 'a, T>(&'b self) -> Result<T, Error> where
T: Deserialize<'b>,
[src]
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));
pub fn deserialize_into<T>(self) -> Result<T, Error> where
T: Deserialize<'a>,
[src]
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
impl<'a> Debug for Value<'a>
[src]
impl<'a> Debug for Value<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Clone for Value<'a>
[src]
impl<'a> Clone for Value<'a>
fn clone(&self) -> Value<'a>
[src]
fn clone(&self) -> Value<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> PartialEq for Value<'a>
[src]
impl<'a> PartialEq for Value<'a>
fn eq(&self, other: &Value<'a>) -> bool
[src]
fn eq(&self, other: &Value<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Value<'a>) -> bool
[src]
fn ne(&self, other: &Value<'a>) -> bool
This method tests for !=
.
impl<'a> From<bool> for Value<'a>
[src]
impl<'a> From<bool> for Value<'a>
impl<'a> TryAsRef<bool> for Value<'a>
[src]
impl<'a> TryAsRef<bool> for Value<'a>
fn try_as_ref(&self) -> Option<&bool>
[src]
fn try_as_ref(&self) -> Option<&bool>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<bool> for Value<'a>
[src]
impl<'a> TryAsMut<bool> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut bool>
[src]
fn try_as_mut(&mut self) -> Option<&mut bool>
Attempt to unwrap the inner reference.
impl<'a> From<i64> for Value<'a>
[src]
impl<'a> From<i64> for Value<'a>
impl<'a> TryAsRef<i64> for Value<'a>
[src]
impl<'a> TryAsRef<i64> for Value<'a>
fn try_as_ref(&self) -> Option<&i64>
[src]
fn try_as_ref(&self) -> Option<&i64>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<i64> for Value<'a>
[src]
impl<'a> TryAsMut<i64> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut i64>
[src]
fn try_as_mut(&mut self) -> Option<&mut i64>
Attempt to unwrap the inner reference.
impl<'a> From<f64> for Value<'a>
[src]
impl<'a> From<f64> for Value<'a>
impl<'a> TryAsRef<f64> for Value<'a>
[src]
impl<'a> TryAsRef<f64> for Value<'a>
fn try_as_ref(&self) -> Option<&f64>
[src]
fn try_as_ref(&self) -> Option<&f64>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<f64> for Value<'a>
[src]
impl<'a> TryAsMut<f64> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut f64>
[src]
fn try_as_mut(&mut self) -> Option<&mut f64>
Attempt to unwrap the inner reference.
impl<'a> From<Box<Cow<'a, [u8]>>> for Value<'a>
[src]
impl<'a> From<Box<Cow<'a, [u8]>>> for Value<'a>
impl<'a> TryAsRef<Box<Cow<'a, [u8]>>> for Value<'a>
[src]
impl<'a> TryAsRef<Box<Cow<'a, [u8]>>> for Value<'a>
impl<'a> TryAsMut<Box<Cow<'a, [u8]>>> for Value<'a>
[src]
impl<'a> TryAsMut<Box<Cow<'a, [u8]>>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, [u8]>>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, [u8]>>>
Attempt to unwrap the inner reference.
impl<'a> From<Box<Cow<'a, str>>> for Value<'a>
[src]
impl<'a> From<Box<Cow<'a, str>>> for Value<'a>
impl<'a> TryAsRef<Box<Cow<'a, str>>> for Value<'a>
[src]
impl<'a> TryAsRef<Box<Cow<'a, str>>> for Value<'a>
impl<'a> TryAsMut<Box<Cow<'a, str>>> for Value<'a>
[src]
impl<'a> TryAsMut<Box<Cow<'a, str>>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, str>>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, str>>>
Attempt to unwrap the inner reference.
impl<'a> From<Box<Cow<'a, List<'a>>>> for Value<'a>
[src]
impl<'a> From<Box<Cow<'a, List<'a>>>> for Value<'a>
impl<'a> TryAsRef<Box<Cow<'a, List<'a>>>> for Value<'a>
[src]
impl<'a> TryAsRef<Box<Cow<'a, List<'a>>>> for Value<'a>
impl<'a> TryAsMut<Box<Cow<'a, List<'a>>>> for Value<'a>
[src]
impl<'a> TryAsMut<Box<Cow<'a, List<'a>>>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, List<'a>>>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, List<'a>>>>
Attempt to unwrap the inner reference.
impl<'a> From<Box<Cow<'a, Table<'a>>>> for Value<'a>
[src]
impl<'a> From<Box<Cow<'a, Table<'a>>>> for Value<'a>
impl<'a> TryAsRef<Box<Cow<'a, Table<'a>>>> for Value<'a>
[src]
impl<'a> TryAsRef<Box<Cow<'a, Table<'a>>>> for Value<'a>
impl<'a> TryAsMut<Box<Cow<'a, Table<'a>>>> for Value<'a>
[src]
impl<'a> TryAsMut<Box<Cow<'a, Table<'a>>>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, Table<'a>>>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Box<Cow<'a, Table<'a>>>>
Attempt to unwrap the inner reference.
impl<'a> From<i8> for Value<'a>
[src]
impl<'a> From<i8> for Value<'a>
impl<'a> From<i16> for Value<'a>
[src]
impl<'a> From<i16> for Value<'a>
impl<'a> From<i32> for Value<'a>
[src]
impl<'a> From<i32> for Value<'a>
impl<'a> From<u8> for Value<'a>
[src]
impl<'a> From<u8> for Value<'a>
impl<'a> From<u16> for Value<'a>
[src]
impl<'a> From<u16> for Value<'a>
impl<'a> From<u32> for Value<'a>
[src]
impl<'a> From<u32> for Value<'a>
impl<'a> From<u64> for Value<'a>
[src]
impl<'a> From<u64> for Value<'a>
impl<'a> From<isize> for Value<'a>
[src]
impl<'a> From<isize> for Value<'a>
impl<'a> From<usize> for Value<'a>
[src]
impl<'a> From<usize> for Value<'a>
impl<'a> From<f32> for Value<'a>
[src]
impl<'a> From<f32> for Value<'a>
impl<'a> From<Cow<'a, [u8]>> for Value<'a>
[src]
impl<'a> From<Cow<'a, [u8]>> for Value<'a>
impl<'a> TryAsRef<Cow<'a, [u8]>> for Value<'a>
[src]
impl<'a> TryAsRef<Cow<'a, [u8]>> for Value<'a>
impl<'a> TryAsMut<Cow<'a, [u8]>> for Value<'a>
[src]
impl<'a> TryAsMut<Cow<'a, [u8]>> for Value<'a>
impl<'a> From<Cow<'a, str>> for Value<'a>
[src]
impl<'a> From<Cow<'a, str>> for Value<'a>
impl<'a> TryAsRef<Cow<'a, str>> for Value<'a>
[src]
impl<'a> TryAsRef<Cow<'a, str>> for Value<'a>
fn try_as_ref(&self) -> Option<&Cow<'a, str>>
[src]
fn try_as_ref(&self) -> Option<&Cow<'a, str>>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<Cow<'a, str>> for Value<'a>
[src]
impl<'a> TryAsMut<Cow<'a, str>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Cow<'a, str>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Cow<'a, str>>
Attempt to unwrap the inner reference.
impl<'a> From<Cow<'a, List<'a>>> for Value<'a>
[src]
impl<'a> From<Cow<'a, List<'a>>> for Value<'a>
impl<'a> TryAsRef<Cow<'a, List<'a>>> for Value<'a>
[src]
impl<'a> TryAsRef<Cow<'a, List<'a>>> for Value<'a>
fn try_as_ref(&self) -> Option<&Cow<'a, List<'a>>>
[src]
fn try_as_ref(&self) -> Option<&Cow<'a, List<'a>>>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<Cow<'a, List<'a>>> for Value<'a>
[src]
impl<'a> TryAsMut<Cow<'a, List<'a>>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Cow<'a, List<'a>>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Cow<'a, List<'a>>>
Attempt to unwrap the inner reference.
impl<'a> From<Cow<'a, Table<'a>>> for Value<'a>
[src]
impl<'a> From<Cow<'a, Table<'a>>> for Value<'a>
impl<'a> TryAsRef<Cow<'a, Table<'a>>> for Value<'a>
[src]
impl<'a> TryAsRef<Cow<'a, Table<'a>>> for Value<'a>
fn try_as_ref(&self) -> Option<&Cow<'a, Table<'a>>>
[src]
fn try_as_ref(&self) -> Option<&Cow<'a, Table<'a>>>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<Cow<'a, Table<'a>>> for Value<'a>
[src]
impl<'a> TryAsMut<Cow<'a, Table<'a>>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Cow<'a, Table<'a>>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Cow<'a, Table<'a>>>
Attempt to unwrap the inner reference.
impl<'a> From<&'a [u8]> for Value<'a>
[src]
impl<'a> From<&'a [u8]> for Value<'a>
impl<'a> From<Vec<u8>> for Value<'a>
[src]
impl<'a> From<Vec<u8>> for Value<'a>
impl<'a> TryAsRef<[u8]> for Value<'a>
[src]
impl<'a> TryAsRef<[u8]> for Value<'a>
impl<'a> TryAsMut<Vec<u8>> for Value<'a>
[src]
impl<'a> TryAsMut<Vec<u8>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Vec<u8>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Vec<u8>>
Attempt to unwrap the inner reference.
impl<'a> From<&'a str> for Value<'a>
[src]
impl<'a> From<&'a str> for Value<'a>
impl<'a> From<String> for Value<'a>
[src]
impl<'a> From<String> for Value<'a>
impl<'a> TryAsRef<str> for Value<'a>
[src]
impl<'a> TryAsRef<str> for Value<'a>
fn try_as_ref(&self) -> Option<&str>
[src]
fn try_as_ref(&self) -> Option<&str>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<String> for Value<'a>
[src]
impl<'a> TryAsMut<String> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut String>
[src]
fn try_as_mut(&mut self) -> Option<&mut String>
Attempt to unwrap the inner reference.
impl<'a> From<&'a List<'a>> for Value<'a>
[src]
impl<'a> From<&'a List<'a>> for Value<'a>
impl<'a> From<List<'a>> for Value<'a>
[src]
impl<'a> From<List<'a>> for Value<'a>
impl<'a> TryAsRef<List<'a>> for Value<'a>
[src]
impl<'a> TryAsRef<List<'a>> for Value<'a>
fn try_as_ref(&self) -> Option<&List<'a>>
[src]
fn try_as_ref(&self) -> Option<&List<'a>>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<List<'a>> for Value<'a>
[src]
impl<'a> TryAsMut<List<'a>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut List<'a>>
[src]
fn try_as_mut(&mut self) -> Option<&mut List<'a>>
Attempt to unwrap the inner reference.
impl<'a> From<&'a Table<'a>> for Value<'a>
[src]
impl<'a> From<&'a Table<'a>> for Value<'a>
impl<'a> From<Table<'a>> for Value<'a>
[src]
impl<'a> From<Table<'a>> for Value<'a>
impl<'a> TryAsRef<Table<'a>> for Value<'a>
[src]
impl<'a> TryAsRef<Table<'a>> for Value<'a>
fn try_as_ref(&self) -> Option<&Table<'a>>
[src]
fn try_as_ref(&self) -> Option<&Table<'a>>
Attempt to unwrap the inner reference.
impl<'a> TryAsMut<Table<'a>> for Value<'a>
[src]
impl<'a> TryAsMut<Table<'a>> for Value<'a>
fn try_as_mut(&mut self) -> Option<&mut Table<'a>>
[src]
fn try_as_mut(&mut self) -> Option<&mut Table<'a>>
Attempt to unwrap the inner reference.
impl<'a> Default for Value<'a>
[src]
impl<'a> Default for Value<'a>
impl<'a> AsRef<Value<'a>> for Value<'a>
[src]
impl<'a> AsRef<Value<'a>> for Value<'a>
impl<'a> AsMut<Value<'a>> for Value<'a>
[src]
impl<'a> AsMut<Value<'a>> for Value<'a>
impl<'a> PartialOrd for Value<'a>
[src]
impl<'a> PartialOrd for Value<'a>
fn partial_cmp(&self, other: &Value<'a>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Value<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a> Serialize for Value<'a>
[src]
impl<'a> Serialize for Value<'a>
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Value<'de>
[src]
impl<'de> Deserialize<'de> for Value<'de>
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a, 'b> From<&'b Value<'a>> for Unexpected<'b>
[src]
impl<'a, 'b> From<&'b Value<'a>> for Unexpected<'b>
fn from(value: &'b Value<'a>) -> Unexpected<'b>
[src]
fn from(value: &'b Value<'a>) -> Unexpected<'b>
Performs the conversion.
impl<'de> Deserializer<'de> for Value<'de>
[src]
impl<'de> Deserializer<'de> for Value<'de>
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, Self::Error> where
V: Visitor<'de>,
[src]
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 more
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 more
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 more
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 more
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.
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. Read more
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.
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. Read more
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.
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a struct with a particular name and fields. Read more
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. Read more
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. Read more
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 more
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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. Read more
fn deserialize_enum<V>(
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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. Read more
fn deserialize_i128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn deserialize_u128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn is_human_readable(&self) -> bool
[src]
fn is_human_readable(&self) -> bool
Determine whether Deserialize
implementations should expect to deserialize their human-readable form. Read more
impl<'de> VariantAccess<'de> for Value<'de>
[src]
impl<'de> VariantAccess<'de> for Value<'de>
type Error = Error
The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess
. Read more
fn unit_variant(self) -> Result<(), Self::Error>
[src]
fn unit_variant(self) -> Result<(), Self::Error>
Called when deserializing a variant with no values. Read more
fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error> where
T: DeserializeSeed<'de>,
[src]
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
fn tuple_variant<V>(
self,
_len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn struct_variant<V>(
self,
_fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn newtype_variant<T>(self) -> Result<T, Self::Error> where
T: Deserialize<'de>,
[src]
fn newtype_variant<T>(self) -> Result<T, Self::Error> where
T: Deserialize<'de>,
Called when deserializing a variant with a single value. Read more
impl<'de: 'a, 'a> Deserializer<'de> for &'de Value<'a>
[src]
impl<'de: 'a, 'a> Deserializer<'de> for &'de Value<'a>
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, Self::Error> where
V: Visitor<'de>,
[src]
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 more
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 more
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 more
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 more
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.
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. Read more
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.
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.
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. Read more
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. Read more
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
Hint that the Deserialize
type is expecting a struct with a particular name and fields. Read more
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. Read more
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 more
fn deserialize_option<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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. Read more
fn deserialize_enum<V>(
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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. Read more
fn deserialize_i128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn deserialize_u128<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn is_human_readable(&self) -> bool
[src]
fn is_human_readable(&self) -> bool
Determine whether Deserialize
implementations should expect to deserialize their human-readable form. Read more
impl<'de: 'a, 'a> VariantAccess<'de> for &'de Value<'a>
[src]
impl<'de: 'a, 'a> VariantAccess<'de> for &'de Value<'a>
type Error = Error
The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess
. Read more
fn unit_variant(self) -> Result<(), Self::Error>
[src]
fn unit_variant(self) -> Result<(), Self::Error>
Called when deserializing a variant with no values. Read more
fn newtype_variant_seed<T>(self, seed: T) -> Result<T::Value, Self::Error> where
T: DeserializeSeed<'de>,
[src]
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
fn tuple_variant<V>(
self,
_len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn struct_variant<V>(
self,
_fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
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
fn newtype_variant<T>(self) -> Result<T, Self::Error> where
T: Deserialize<'de>,
[src]
fn newtype_variant<T>(self) -> Result<T, Self::Error> where
T: Deserialize<'de>,
Called when deserializing a variant with a single value. Read more