Trait serde::de::EnumVisitor
[−]
[src]
pub trait EnumVisitor { type Error: Error; type Variant: VariantVisitor<Error=Self::Error>; 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
type Error: Error
The error type that can be returned if some error occurs during deserialization.
type Variant: VariantVisitor<Error=Self::Error>
The Visitor
that will be used to deserialize the content of the enum
variant.
Required Methods
fn visit_variant<V>(self) -> Result<(V, Self::Variant), Self::Error> where V: Deserialize
visit_variant
is called to identify which variant to deserialize.
Implementors
impl<'a, E> EnumVisitor for StrDeserializer<'a, E> where E: Error
impl<'a, E> EnumVisitor for StringDeserializer<E> where E: Error
impl<'a, E> EnumVisitor for CowStrDeserializer<'a, E> where E: Error