Struct rmp_serde::decode::VariantVisitor
[−]
[src]
pub struct VariantVisitor<'a, R: Read + '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: Read + 'a> VariantVisitor<'a, R>
[src]
fn new(de: &'a mut Deserializer<R>) -> Self
Trait Implementations
impl<'a, R: Read> EnumVisitor for VariantVisitor<'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 visit_variant_seed<V>(self, seed: V) -> Result<(V::Value, Self), Error> where V: DeserializeSeed
visit_variant
is called to identify which variant to deserialize. Read more
fn visit_variant<V>(self) -> Result<(V, Self::Variant), Self::Error> where V: Deserialize
visit_variant
is called to identify which variant to deserialize. Read more
impl<'a, R: Read> VariantVisitor for VariantVisitor<'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 EnumVisitor
. Read more
fn visit_unit(self) -> Result<(), Error>
Called when deserializing a variant with no values. Read more
fn visit_newtype_seed<T>(self, seed: T) -> Result<T::Value, Self::Error> where T: DeserializeSeed
Called when deserializing a variant with a single value. Read more
fn visit_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value, Error> where V: Visitor
Called when deserializing a tuple-like variant. Read more
fn visit_struct<V>(self,
fields: &'static [&'static str],
visitor: V)
-> Result<V::Value, Error> where V: Visitor
fields: &'static [&'static str],
visitor: V)
-> Result<V::Value, Error> where V: Visitor
Called when deserializing a struct-like variant. Read more
fn visit_newtype<T>(self) -> Result<T, Self::Error> where T: Deserialize
Called when deserializing a variant with a single value. Read more