Trait serde::de::EnumVisitor [] [src]

pub trait EnumVisitor: Sized {
    type Error: Error;
    type Variant: VariantVisitor<Error=Self::Error>;
    fn visit_variant_seed<V>(self,
                             seed: V)
                             -> Result<(V::Value, Self::Variant), Self::Error> where V: DeserializeSeed; fn visit_variant<V>(self) -> Result<(V, Self::Variant), Self::Error> where V: Deserialize { ... } }

EnumVisitor is a visitor that is created by the Deserializer and passed to the Deserialize in order to identify which variant of an enum to deserialize.

Associated Types

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

The Visitor that will be used to deserialize the content of the enum variant.

Required Methods

visit_variant is called to identify which variant to deserialize.

Deserialize implementations should typically use EnumVisitor::visit_variant instead.

Provided Methods

visit_variant is called to identify which variant to deserialize.

This method exists as a convenience for Deserialize implementations. EnumVisitor implementations should not override the default behavior.

Implementors