Decoder

Trait Decoder 

Source
pub trait Decoder<T: CodecConfig>:
    Codec<T>
    + Send
    + Sync {
    // Required methods
    fn send_packet(
        &mut self,
        config: &T,
        pool: Option<&Arc<FramePool<Frame<'static>>>>,
        packet: Packet<'_>,
    ) -> Result<()>;
    fn receive_frame_borrowed(&mut self, config: &T) -> Result<Frame<'_>>;
    fn flush(&mut self, config: &T) -> Result<()>;

    // Provided methods
    fn init(&mut self, _config: &T) -> Result<()> { ... }
    fn receive_frame(
        &mut self,
        config: &T,
        pool: Option<&Arc<FramePool<Frame<'static>>>>,
    ) -> Result<SharedFrame<Frame<'static>>> { ... }
}

Required Methods§

Source

fn send_packet( &mut self, config: &T, pool: Option<&Arc<FramePool<Frame<'static>>>>, packet: Packet<'_>, ) -> Result<()>

Source

fn receive_frame_borrowed(&mut self, config: &T) -> Result<Frame<'_>>

Source

fn flush(&mut self, config: &T) -> Result<()>

Provided Methods§

Source

fn init(&mut self, _config: &T) -> Result<()>

Source

fn receive_frame( &mut self, config: &T, pool: Option<&Arc<FramePool<Frame<'static>>>>, ) -> Result<SharedFrame<Frame<'static>>>

Implementors§