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