Skip to main content

KVEncode

Trait KVEncode 

Source
pub trait KVEncode {
    // Required method
    fn encode_kv<W: IoWrite>(
        &self,
        writer: &mut W,
    ) -> Result<usize, Error<W::Error>>;
}
Expand description

A key-value encoder that writes a single key, value pair.

Required Methods§

Source

fn encode_kv<W: IoWrite>( &self, writer: &mut W, ) -> Result<usize, Error<W::Error>>

Encode this key‑value pair to the writer and return the number of bytes written.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<K: Encode, V: Encode> KVEncode for (K, V)

Source§

fn encode_kv<W: IoWrite>( &self, writer: &mut W, ) -> Result<usize, Error<W::Error>>

Source§

impl<KV: KVEncode> KVEncode for &KV

Source§

fn encode_kv<W: IoWrite>( &self, writer: &mut W, ) -> Result<usize, Error<W::Error>>

Implementors§