Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

Encode

Trait Encode 

pub trait Encode {
    // Required method
    fn encode<E>(&self, encoder: &mut E)
       where E: Encoder;

    // Provided methods
    fn encode_v1(&self) -> Vec<u8>  { ... }
    fn encode_v2(&self) -> Vec<u8>  { ... }
}
Expand description

A trait that can be implemented by any other type in order to support lib0 encoding capability.

Required Methods§

fn encode<E>(&self, encoder: &mut E)
where E: Encoder,

Provided Methods§

fn encode_v1(&self) -> Vec<u8>

Helper function for encoding 1st version of lib0 encoding.

fn encode_v2(&self) -> Vec<u8>

Helper function for encoding 2nd version of lib0 encoding.

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§

§

impl Encode for Range<u32>

§

fn encode<E>(&self, encoder: &mut E)
where E: Encoder,

Implementors§