Trait Decompressor

Source
pub trait Decompressor<B: ByteBuf> {
    type Buf: ByteBuf;

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

A trait for record decompression algorithms.

Required Associated Types§

Source

type Buf: ByteBuf

Target buffer type for decompression.

Required Methods§

Source

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

Decompress records from B mapped using F into R.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B: ByteBuf> Decompressor<B> for Gzip

Available on crate feature gzip only.
Source§

impl<B: ByteBuf> Decompressor<B> for Lz4

Available on crate feature lz4 only.
Source§

impl<B: ByteBuf> Decompressor<B> for None

Source§

type Buf = B

Source§

impl<B: ByteBuf> Decompressor<B> for Snappy

Available on crate feature snappy only.
Source§

impl<B: ByteBuf> Decompressor<B> for Zstd

Available on crate feature zstd only.