pub trait VariantVisitor<'de> {
type Output;
// Required methods
fn variant_names(&self) -> impl Iterator<Item = &str>;
fn visit_tag<E>(self, tag: u8) -> Result<Self::Output, E>
where E: Error;
fn visit_name<E>(self, name: &str) -> Result<Self::Output, E>
where E: Error;
}Expand description
A visitor passed from SumVisitor to SumAccess::variant
which the latter uses to decide what variant to deserialize.
Required Associated Types§
Required Methods§
Sourcefn variant_names(&self) -> impl Iterator<Item = &str>
fn variant_names(&self) -> impl Iterator<Item = &str>
Provides a list of variant names.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".