Struct rmp_serde::decode::VariantVisitor [] [src]

pub struct VariantVisitor<'a, R: Read + 'a> {
    // some 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>) -> VariantVisitor<'a, R>

Trait Implementations

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.

fn visit_variant<V>(&mut self) -> Result<V> where V: Deserialize

visit_variant is called to identify which variant to deserialize.

fn visit_unit(&mut self) -> Result<()>

visit_unit is called when deserializing a variant with no values.

fn visit_tuple<V>(&mut self, len: usize, visitor: V) -> Result<V::Value> where V: Visitor

visit_tuple is called when deserializing a tuple-like variant.

fn visit_struct<V>(&mut self, fields: &'static [&'static str], visitor: V) -> Result<V::Value> where V: Visitor

visit_struct is called when deserializing a struct-like variant.

fn visit_newtype<T>(&mut self) -> Result<T, Self::Error> where T: Deserialize

visit_newtype is called when deserializing a variant with a single value. By default this uses the visit_tuple method to deserialize the value. Read more