kafka_protocol::compression

Trait Compressor

source
pub trait Compressor<B: ByteBufMut> {
    type BufMut: ByteBufMut;

    // Required method
    fn compress<R, F>(buf: &mut B, f: F) -> Result<R>
       where F: FnOnce(&mut Self::BufMut) -> Result<R>;
}
Expand description

A trait for record compression algorithms.

Required Associated Types§

source

type BufMut: ByteBufMut

Target buffer type for compression.

Required Methods§

source

fn compress<R, F>(buf: &mut B, f: F) -> Result<R>
where F: FnOnce(&mut Self::BufMut) -> Result<R>,

Compresses into provided ByteBufMut, with records encoded by F into R.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B: ByteBufMut> Compressor<B> for Gzip

Available on crate feature gzip only.
source§

impl<B: ByteBufMut> Compressor<B> for Lz4

Available on crate feature lz4 only.
source§

impl<B: ByteBufMut> Compressor<B> for None

source§

impl<B: ByteBufMut> Compressor<B> for Snappy

Available on crate feature snappy only.
source§

impl<B: ByteBufMut> Compressor<B> for Zstd

Available on crate feature zstd only.