pub trait Codec<A> {
// Required methods
fn encode(&self, item: A) -> Option<Vec<u8>>;
fn decode(&self, bytes: &mut [u8]) -> Option<A>;
}Expand description
A trait for codecs for a specic type A, usually an event type stored on a CommitLog.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".