Trait kafka_protocol::compression::Compressor
source · [−]pub trait Compressor<B: ByteBufMut> {
type BufMut: ByteBufMut;
fn compress<R, F>(buf: &mut B, f: F) -> Result<R, EncodeError>
where
F: FnOnce(&mut Self::BufMut) -> Result<R, EncodeError>;
}
Expand description
A trait for record compression algorithms.
Associated Types
type BufMut: ByteBufMut
type BufMut: ByteBufMut
Target buffer type for compression.
Required methods
fn compress<R, F>(buf: &mut B, f: F) -> Result<R, EncodeError> where
F: FnOnce(&mut Self::BufMut) -> Result<R, EncodeError>,
fn compress<R, F>(buf: &mut B, f: F) -> Result<R, EncodeError> where
F: FnOnce(&mut Self::BufMut) -> Result<R, EncodeError>,
Compresses into provided ByteBufMut
, with records encoded by F
into R
.