pub trait Encoder<T: CodecConfiguration>:
Codec<T>
+ Send
+ Sync {
// Required methods
fn send_frame(&mut self, config: &T, frame: &Frame<'_>) -> Result<()>;
fn receive_packet_borrowed(&mut self, config: &T) -> Result<Packet<'_>>;
fn flush(&mut self, config: &T) -> Result<()>;
// Provided method
fn receive_packet(&mut self, config: &T) -> Result<Packet<'static>> { ... }
}