pub trait Compressor:
Send
+ Sync
+ Unpin
+ 'static {
// Required methods
fn compression_type(&self) -> CompressionType;
fn compress(&self, data: &[u8]) -> Result<Bytes, Error>;
}Expand description
This trait is used to implement message-level compression algorithms for payloads.
On outgoing messages, the payload is compressed before being sent using the compress method.
Required Methods§
Sourcefn compression_type(&self) -> CompressionType
fn compression_type(&self) -> CompressionType
Returns the compression type assigned to this compressor.