pub trait NamedProductAccess<'de> {
    type Error: Error;

    // Required methods
    fn get_field_ident<V: FieldNameVisitor<'de>>(
        &mut self,
        visitor: V
    ) -> Result<Option<V::Output>, Self::Error>;
    fn get_field_value_seed<T: DeserializeSeed<'de>>(
        &mut self,
        seed: T
    ) -> Result<T::Output, Self::Error>;

    // Provided method
    fn get_field_value<T: Deserialize<'de>>(&mut self) -> Result<T, Self::Error> { ... }
}
Expand description

Provides a ProductVisitor with access to each element of the named product in the input.

This is a trait that a Deserializer passes to a ProductVisitor implementation.

Required Associated Types§

source

type Error: Error

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

Required Methods§

source

fn get_field_ident<V: FieldNameVisitor<'de>>( &mut self, visitor: V ) -> Result<Option<V::Output>, Self::Error>

Deserializes field name of type V::Output from the input using a visitor provided by the deserializer.

source

fn get_field_value_seed<T: DeserializeSeed<'de>>( &mut self, seed: T ) -> Result<T::Output, Self::Error>

Statefully deserializes the field value T::Output from the input provided a seed value.

Deserialize implementations should typically use next_element instead.

Provided Methods§

source

fn get_field_value<T: Deserialize<'de>>(&mut self) -> Result<T, Self::Error>

Deserializes field value of type T from the input.

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

Object Safety§

This trait is not object safe.

Implementors§