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<()> { ... }
}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 Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".