pub trait ArrayAccess<'de> {
    type Element;
    type Error: Error;

    // Required method
    fn next_element(&mut self) -> Result<Option<Self::Element>, Self::Error>;

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

Provides an ArrayVisitor with access to each element of the array in the input.

This is a trait that a Deserializer passes to an ArrayVisitor implementation.

Required Associated Types§

source

type Element

The element / base type of the array.

source

type Error: Error

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

Required Methods§

source

fn next_element(&mut self) -> Result<Option<Self::Element>, Self::Error>

This returns Ok(Some(value)) for the next element in the array, or Ok(None) if there are no more remaining elements.

Provided Methods§

source

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

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

Implementors§

source§

impl<'de, 'a, R, T> ArrayAccess<'de> for ArrayAccess<'a, R, T>
where R: BufReader<'de>, T: DeserializeSeed<'de> + Clone,

source§

impl<'de, A> ArrayAccess<'de> for A
where A: MapAccess<'de>,

§

type Element = (<A as MapAccess<'de>>::Key, <A as MapAccess<'de>>::Value)

§

type Error = <A as MapAccess<'de>>::Error