pub trait Codec<T> {
// Required methods
fn encode(&self, value: &T) -> Result<Vec<u8>>;
fn decode(&self, bytes: &[u8]) -> Result<T>;
}Expand description
Deterministic serialization boundary used by durable stores.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Codec<ProjectionSnapshot<MemoryProjection>> for CompactSnapshotCodec
impl<T, C, K, N> Codec<T> for XChaCha20Codec<C, K, N>
impl<T, C> Codec<T> for Lz4Codec<C>where
C: Codec<T>,
impl<T> Codec<T> for JsonCodecwhere
T: Serialize + DeserializeOwned,
Available on crate feature
json only.