Skip to main content

WireMap

Trait WireMap 

Source
pub trait WireMap<K, V> {
    // Required methods
    fn entry_count(&self) -> usize;
    fn try_visit<E, F: FnMut(&K, &V) -> Result<(), E>>(
        &self,
        visit: F,
    ) -> Result<(), E>;
}
Expand description

What the writer takes of a map: its size and its entries in the order they go on the wire.

Required Methods§

Source

fn entry_count(&self) -> usize

The number of entries.

Source

fn try_visit<E, F: FnMut(&K, &V) -> Result<(), E>>( &self, visit: F, ) -> Result<(), E>

Calls visit with each entry, in wire order, stopping at the first error.

§Errors

The first error visit returns.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K, V> WireMap<K, V> for BTreeMap<K, V>

Source§

fn entry_count(&self) -> usize

Source§

fn try_visit<E, F: FnMut(&K, &V) -> Result<(), E>>( &self, visit: F, ) -> Result<(), E>

Source§

impl<K, V> WireMap<K, V> for Vec<MapEntry<K, V>>

Source§

fn entry_count(&self) -> usize

Source§

fn try_visit<E, F: FnMut(&K, &V) -> Result<(), E>>( &self, visit: F, ) -> Result<(), E>

Source§

impl<K, V> WireMap<K, V> for [MapEntry<K, V>]

Source§

fn entry_count(&self) -> usize

Source§

fn try_visit<E, F: FnMut(&K, &V) -> Result<(), E>>( &self, visit: F, ) -> Result<(), E>

Implementors§

Source§

impl<K: Ord, V> WireMap<K, V> for AscendingKey<'_, K, V>