Trait serde::de::MapVisitor [] [src]

pub trait MapVisitor {
    type Error: Error;
    fn visit_key<K>(&mut self) -> Result<Option<K>, Self::Error> where K: Deserialize;
    fn visit_value<V>(&mut self) -> Result<V, Self::Error> where V: Deserialize;
    fn end(&mut self) -> Result<(), Self::Error>;

    fn visit<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error> where K: Deserialize, V: Deserialize { ... }
    fn size_hint(&self) -> (usize, Option<usize>) { ... }
    fn missing_field<V>(&mut self, field: &'static str) -> Result<V, Self::Error> where V: Deserialize { ... }
}

MapVisitor visits each item in a sequence.

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

Associated Types

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

Required Methods

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

This returns a Ok(value) for the next value in the map.

This signals to the MapVisitor that the Visitor does not expect any more items.

Provided Methods

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

Return the lower and upper bound of items remaining in the sequence.

Report that the struct has a field that wasn't deserialized

Implementors