[−][src]Trait destream::de::MapAccess
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
Loading content...Required methods
#[must_use]pub fn next_key<'life0, 'async_trait, K: FromStream>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<K>, Self::Error>> + Send + 'async_trait>> where
K: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<K>, Self::Error>> + Send + 'async_trait>> where
K: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
This returns Ok(Some(key))
for the next key in the map, or Ok(None)
if there are no more remaining entries.
#[must_use]pub fn next_value<'life0, 'async_trait, V: FromStream>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<V, Self::Error>> + Send + 'async_trait>> where
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<V, Self::Error>> + Send + 'async_trait>> where
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
This returns a Ok(value)
for the next value in the map.
Panics
Calling next_value
before next_key
is incorrect and is allowed to
panic or return bogus results.
#[must_use]pub fn next_entry<'life0, 'async_trait, K: FromStream, V: FromStream>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<(K, V)>, Self::Error>> + Send + 'async_trait>> where
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<(K, V)>, Self::Error>> + Send + 'async_trait>> where
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
This returns Ok(Some((key, value)))
for the next (key-value) pair in
the map, or Ok(None)
if there are no more remaining items.
This method exists as a convenience for FromStream
implementations.
MapAccess
implementations should not override the default behavior.
Provided methods
pub fn size_hint(&self) -> Option<usize>
[src]
Returns the number of entries remaining in the map, if known.