pub trait MapAccess<'de> {
    type Key;
    type Value;
    type Error: Error;

    // Required method
    fn next_entry(
        &mut self
    ) -> Result<Option<(Self::Key, Self::Value)>, Self::Error>;

    // Provided method
    fn size_hint(&self) -> Option<usize> { ... }
}
Expand description

Provides a MapVisitor with access to each element of the array in the input.

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

Required Associated Types§

source

type Key

The key type of the map.

source

type Value

The value type of the map.

source

type Error: Error

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

Required Methods§

source

fn next_entry( &mut self ) -> Result<Option<(Self::Key, Self::Value)>, Self::Error>

This returns Ok(Some((key, value))) for the next (key-value) pair in the map, or Ok(None) if there are no more remaining items.

Provided Methods§

source

fn size_hint(&self) -> Option<usize>

Returns the number of elements remaining in the map, if known.

Implementors§

source§

impl<'de, 'a, R: BufReader<'de>, K: DeserializeSeed<'de> + Clone, V: DeserializeSeed<'de> + Clone> MapAccess<'de> for MapAccess<'a, R, K, V>

§

type Key = <K as DeserializeSeed<'de>>::Output

§

type Value = <V as DeserializeSeed<'de>>::Output

§

type Error = DecodeError