pub trait ValueCodec {
// Required methods
fn encode<T: Serialize>(&self, value: &T) -> Result<Vec<u8>, Error>;
fn decode<T: DeserializeOwned>(&self, bytes: &[u8]) -> Result<T, Error>;
}Expand description
Codec for converting typed application values to and from stored bytes.
The core tree stores Vec<u8> leaf values. A ValueCodec is a small
reusable adapter that keeps application encode/decode policy next to the
schema that owns it.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".