ConnectionCodec

Trait ConnectionCodec 

Source
pub trait ConnectionCodec:
    Debug
    + Send
    + Sync {
    // Required methods
    fn try_encode(
        &self,
        value: &dyn Connection,
        conn_options: &ConnectionOptions,
    ) -> Result<Vec<u8>>;
    fn try_decode(
        &self,
        value: &[u8],
        conn_options: &ConnectionOptions,
    ) -> Result<Arc<dyn Connection>>;
}

Required Methods§

Source

fn try_encode( &self, value: &dyn Connection, conn_options: &ConnectionOptions, ) -> Result<Vec<u8>>

Source

fn try_decode( &self, value: &[u8], conn_options: &ConnectionOptions, ) -> Result<Arc<dyn Connection>>

Implementors§