pub trait Codec<T>:
Send
+ Sync
+ 'static {
type Error: Error + Send;
// Required methods
fn decode(&self, bytes: Bytes) -> Result<T, Self::Error>;
fn encode(&self, msg: &T) -> Result<Bytes, Self::Error>;
}pub trait Codec<T>:
Send
+ Sync
+ 'static {
type Error: Error + Send;
// Required methods
fn decode(&self, bytes: Bytes) -> Result<T, Self::Error>;
fn encode(&self, msg: &T) -> Result<Bytes, Self::Error>;
}