Struct rmp_serde::decode::VariantAccess
[−]
[src]
pub struct VariantAccess<'a, R: 'a> { /* fields omitted */ }
Default variant visitor.
Note
We use default behaviour for new type, which decodes enums with a single value as a tuple.
Methods
impl<'a, R: 'a> VariantAccess<'a, R>
[src]
fn new(de: &'a mut Deserializer<R>) -> Self
Trait Implementations
impl<'de, 'a, R: Read<'de>> EnumAccess<'de> for VariantAccess<'a, R>
[src]
type Error = Error
The error type that can be returned if some error occurs during deserialization. Read more
type Variant = Self
The Visitor
that will be used to deserialize the content of the enum variant. Read more
fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self), Error> where
V: DeserializeSeed<'de>,
V: DeserializeSeed<'de>,
variant
is called to identify which variant to deserialize. Read more
fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error> where
V: Deserialize<'de>,
V: Deserialize<'de>,
variant
is called to identify which variant to deserialize. Read more
impl<'de, 'a, R: Read<'de>> VariantAccess<'de> for VariantAccess<'a, R>
[src]
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<(), 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>,
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, Error> where
V: Visitor<'de>,
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, Error> where
V: Visitor<'de>,
self,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, 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>,
T: Deserialize<'de>,
Called when deserializing a variant with a single value. Read more