Trait serde::de::EnumAccess [] [src]

pub trait EnumAccess<'de>: Sized {
    type Error: Error;
    type Variant: VariantAccess<'de, Error = Self::Error>;
    fn variant_seed<V>(
        self,
        seed: V
    ) -> Result<(V::Value, Self::Variant), Self::Error>
    where
        V: DeserializeSeed<'de>
; fn variant<V>(self) -> Result<(V, Self::Variant), Self::Error>
    where
        V: Deserialize<'de>
, { ... } }

Provides a Visitor access to the data of an enum in the input.

EnumAccess is created by the Deserializer and passed to the Visitor 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

variant is called to identify which variant to deserialize.

Deserialize implementations should typically use EnumAccess::variant instead.

Provided Methods

variant is called to identify which variant to deserialize.

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

Implementors