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

    // Required method
    fn next_element_seed<T: DeserializeSeed<'de>>(
        &mut self,
        seed: T
    ) -> Result<Option<T::Output>, Self::Error>;

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

Provides a ProductVisitor with access to each element of the unnamed 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 next_element_seed<T: DeserializeSeed<'de>>( &mut self, seed: T ) -> Result<Option<T::Output>, Self::Error>

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

Returns Ok(Some(value)) for the next element in the unnamed product, or Ok(None) if there are no more remaining items.

Deserialize implementations should typically use next_element instead.

Provided Methods§

source

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

Deserializes an T from the input.

Returns Ok(Some(value)) for the next element in the product, or Ok(None) if there are no more remaining items.

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'de, 'a, R: BufReader<'de>> SeqProductAccess<'de> for Deserializer<'a, R>