Trait serde::de::SeqVisitor
[−]
[src]
pub trait SeqVisitor { type Error: Error; fn visit_seed<T>(&mut self,
seed: T)
-> Result<Option<T::Value>, Self::Error> where T: DeserializeSeed; fn visit<T>(&mut self) -> Result<Option<T>, Self::Error> where T: Deserialize { ... } fn size_hint(&self) -> (usize, Option<usize>) { ... } }
SeqVisitor
visits each item in a sequence.
This is a trait that a Deserializer
passes to a Visitor
implementation,
which deserializes each item in a sequence.
Associated Types
Required Methods
fn visit_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Self::Error> where T: DeserializeSeed
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 SeqVisitor::visit
instead.
Provided Methods
fn visit<T>(&mut self) -> Result<Option<T>, Self::Error> where T: Deserialize
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.
SeqVisitor
implementations should not override the default behavior.
fn size_hint(&self) -> (usize, Option<usize>)
Return the lower and upper bound of items remaining in the sequence.
Implementors
impl<I, T, E> SeqVisitor for SeqDeserializer<I, E> where I: Iterator<Item=T>, T: ValueDeserializer<E>, E: Error
impl<I, E> SeqVisitor for MapDeserializer<I, E> where I: Iterator,
I::Item: Pair,
I::Item::First: ValueDeserializer<E>,
I::Item::Second: ValueDeserializer<E>,
E: Errorimpl<'a, V> SeqVisitor for &'a mut V where V: SeqVisitor