pub trait Codec:
Send
+ Sync
+ 'static {
// Required methods
fn encode<T>(&self, value: &T) -> Result<Vec<u8>, KojinError>
where T: Serialize;
fn decode<T>(&self, data: &[u8]) -> Result<T, KojinError>
where T: DeserializeOwned;
}Expand description
Serialization codec for task payloads.
Required Methods§
fn encode<T>(&self, value: &T) -> Result<Vec<u8>, KojinError>where
T: Serialize,
fn decode<T>(&self, data: &[u8]) -> Result<T, KojinError>where
T: DeserializeOwned,
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.