ArrayAccess

Trait ArrayAccess 

Source
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, R, T> ArrayAccess<'de> for ArrayAccess<'_, R, T>
where R: BufReader<'de>, T: DeserializeSeed<'de> + Clone,