pub trait ValueCodec {
type Error: Error + 'static;
// Required methods
fn serialize<T: ?Sized + Clone + Into<Vec<u8>>>(
val: &T,
) -> Result<Vec<u8>, SuberError>;
fn deserialize<T: TryFrom<Vec<u8>>>(bytes: &[u8]) -> Result<T, SuberError>;
}Required Associated Types§
Required Methods§
fn serialize<T: ?Sized + Clone + Into<Vec<u8>>>( val: &T, ) -> Result<Vec<u8>, SuberError>
fn deserialize<T: TryFrom<Vec<u8>>>(bytes: &[u8]) -> Result<T, SuberError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".