Skip to main content

Compression

Trait Compression 

Source
pub trait Compression: Sized {
    // Required methods
    fn try_new() -> Result<Self, Error>;
    fn encode(&mut self, bytes: &[u8]) -> Output;
}
Expand description

Compression storage selected when constructing a protocol connection.

Required Methods§

Source

fn try_new() -> Result<Self, Error>

Source

fn encode(&mut self, bytes: &[u8]) -> Output

Returns a smaller gzip body or keeps the original bytes unchanged.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Compression for ()

Source§

fn try_new() -> Result<Self, Error>

Source§

fn encode(&mut self, _: &[u8]) -> Output

Implementors§