pub trait CodecExt: Codec {
// Provided methods
fn serialise<T>(&self, value: &T) -> Result<ValueBytes>
where T: Serialize { ... }
fn deserialise<T>(&self, bytes: &ValueBytes) -> Result<T>
where T: DeserializeOwned { ... }
}Expand description
Typed codec helpers.
Provided Methods§
Sourcefn serialise<T>(&self, value: &T) -> Result<ValueBytes>where
T: Serialize,
fn serialise<T>(&self, value: &T) -> Result<ValueBytes>where
T: Serialize,
Serialises a typed value into bytes.
Sourcefn deserialise<T>(&self, bytes: &ValueBytes) -> Result<T>where
T: DeserializeOwned,
fn deserialise<T>(&self, bytes: &ValueBytes) -> Result<T>where
T: DeserializeOwned,
Deserialises bytes into a typed value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".