Trait Encoder
Source pub trait Encoder<T: CodecConfig>:
Codec<T>
+ Send
+ Sync {
// Required methods
fn send_frame(
&mut self,
config: &T,
pool: Option<&Arc<BufferPool>>,
frame: SharedFrame<Frame<'static>>,
) -> Result<()>;
fn receive_packet_borrowed(&mut self, config: &T) -> Result<Packet<'_>>;
fn flush(&mut self, config: &T) -> Result<()>;
// Provided methods
fn init(&mut self, _config: &T) -> Result<()> { ... }
fn receive_packet(
&mut self,
config: &T,
pool: Option<&Arc<BufferPool>>,
) -> Result<Packet<'static>> { ... }
}