Trait serde::de::SeqAccess
[−]
[src]
pub trait SeqAccess<'de> { type Error: Error; fn next_element_seed<T>(&mut self,
seed: T)
-> Result<Option<T::Value>, Self::Error> where T: DeserializeSeed<'de>; fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error> where T: Deserialize<'de> { ... } fn size_hint(&self) -> Option<usize> { ... } }
Provides a Visitor
access to each element of a sequence in the input.
This is a trait that a Deserializer
passes to a Visitor
implementation,
which deserializes each item in a sequence.
Associated Types
Required Methods
fn next_element_seed<T>(&mut self,
seed: T)
-> Result<Option<T::Value>, Self::Error> where T: DeserializeSeed<'de>
seed: T)
-> Result<Option<T::Value>, Self::Error> where T: DeserializeSeed<'de>
This returns Ok(Some(value))
for the next value in the sequence, or
Ok(None)
if there are no more remaining items.
Deserialize
implementations should typically use
SeqAcccess::next_element
instead.
Provided Methods
fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error> where T: Deserialize<'de>
This returns Ok(Some(value))
for the next value in the sequence, or
Ok(None)
if there are no more remaining items.
This method exists as a convenience for Deserialize
implementations.
SeqAccess
implementations should not override the default behavior.
fn size_hint(&self) -> Option<usize>
Returns the number of elements remaining in the sequence, if known.
Implementors
impl<'de, I, T, E> SeqAccess<'de> for SeqDeserializer<I, E> where I: Iterator<Item=T>, T: IntoDeserializer<'de, E>, E: Error
impl<'de, I, E> SeqAccess<'de> for MapDeserializer<'de, I, E> where I: Iterator,
I::Item: Pair,
I::Item::First: IntoDeserializer<'de, E>,
I::Item::Second: IntoDeserializer<'de, E>,
E: Errorimpl<'de, 'a, A> SeqAccess<'de> for &'a mut A where A: SeqAccess<'de>