Trait destream::de::MapAccess[][src]

pub trait MapAccess: Send {
    type Error: Error;
    fn next_key<'life0, 'async_trait, K: FromStream>(
        &'life0 mut self,
        context: K::Context
    ) -> Pin<Box<dyn Future<Output = Result<Option<K>, Self::Error>> + Send + 'async_trait>>
    where
        K: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
;
fn next_value<'life0, 'async_trait, V: FromStream>(
        &'life0 mut self,
        context: V::Context
    ) -> Pin<Box<dyn Future<Output = Result<V, Self::Error>> + Send + 'async_trait>>
    where
        V: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn size_hint(&self) -> Option<usize> { ... } }
Expand description

Provides a Visitor access to each entry of a map in the input.

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

Associated Types

Type to return in case of a decoding error.

Required methods

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

context is the decoder context used by K’s FromStream impl. If K is small enough to fit in main memory, pass the unit context ().

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

context is the decoder context used by V’s FromStream impl. If V is small enough to fit in main memory, pass the unit context ().

Panics

Calling next_value before next_key is incorrect and is allowed to panic or return bogus results.

Provided methods

Returns the number of entries remaining in the map, if known.

Implementors