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

pub trait MapAccess: Send {
    type Error: Error;
#[must_use]    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
;
#[must_use] 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> { ... } }

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 Error: Error[src]

Type to return in case of a decoding error.

Loading content...

Required methods

#[must_use]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, 
[src]

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 ().

#[must_use]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, 
[src]

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.

Loading content...

Provided methods

fn size_hint(&self) -> Option<usize>[src]

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

Loading content...

Implementors

Loading content...