informalsystems_malachitebft_codec/
lib.rs1use core::error::Error;
2
3use bytes::Bytes;
4
5pub trait Codec<T>: Send + Sync + 'static {
6 type Error: Error + Send;
7
8 fn decode(&self, bytes: Bytes) -> Result<T, Self::Error>;
9 fn encode(&self, msg: &T) -> Result<Bytes, Self::Error>;
10}