pub trait CoolCodec:
Clone
+ Send
+ Sync
+ 'static {
const CONTENT_TYPE: &'static str;
// Required methods
fn encode<T>(&self, value: &T) -> Result<Vec<u8>, CoolError>
where T: Serialize + ?Sized;
fn decode<T>(&self, bytes: &[u8]) -> Result<T, CoolError>
where T: for<'de> Deserialize<'de>;
}Required Associated Constants§
const CONTENT_TYPE: &'static str
Required Methods§
fn encode<T>(&self, value: &T) -> Result<Vec<u8>, CoolError>
fn decode<T>(&self, bytes: &[u8]) -> Result<T, CoolError>where
T: for<'de> Deserialize<'de>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.