[][src]Trait cdrs_async::Compressor

pub trait Compressor {
    type CompressorError: Error + Sized;
    fn encode(&self, bytes: Vec<u8>) -> Result<Vec<u8>, Self::CompressorError>;
fn decode(&self, bytes: Vec<u8>) -> Result<Vec<u8>, Self::CompressorError>;
fn into_string(&self) -> Option<String>; }

Compressor trait that defines functionality which should be provided by typical compressor.

Associated Types

Loading content...

Required methods

fn encode(&self, bytes: Vec<u8>) -> Result<Vec<u8>, Self::CompressorError>

Encodes given bytes and returns Result that contains either encoded data or an error which occures during the transformation.

fn decode(&self, bytes: Vec<u8>) -> Result<Vec<u8>, Self::CompressorError>

Encodes given encoded data and returns Result that contains either encoded bytes or an error which occures during the transformation.

fn into_string(&self) -> Option<String>

Returns a string which is a name of a compressor. This name should be exactly the same as one which server returns in a response to Options request.

Loading content...

Implementors

impl Compressor for Compression[src]

type CompressorError = CompressionError

Loading content...