fn wrap<'a, W: Write + 'a>(self, inner: W, level: u8) -> Box<dyn Write + 'a> {
        match self {
            Self::Gzip => Box::new(GzEncoder::new(inner, flate2::Compression::new(level.into()))),
            Self::Xz => Box::new(XzEncoder::new(inner, level.into())),
            Self::Zstd => Box::new(
                zstd::Encoder::new(inner, level.into())
                    .expect("valid zstd encoder")
                    .auto_finish(),
            ),
        }
    }
/// Wraps a writer with a compression layer on top.
Wraps a writer with a compression layer on top.
Wraps a writer with a compression layer on top .
fn wrap<'a, W: Write + 'a>(self, inner: W, level: u8) -> Box<dyn Write + 'a> {
        match self {
            Self::Gzip => Box::new(GzEncoder::new(inner, flate2::Compression::new(level.into()))),
            Self::Xz => Box::new(XzEncoder::new(inner, level.into())),
            Self::Zstd => Box::new(
                zstd::Encoder::new(inner, level.into())
                    .expect("valid zstd encoder")
                    .auto_finish(),
            ),
        }
    }
fn wrap < ' a , W : Write + ' a > ( self , inner : W , level : u8 ) -> Box < dyn Write + ' a > { match self { Self :: Gzip => Box :: new ( GzEncoder :: new ( inner , flate2 :: Compression :: new ( level . into ( ) ) ) ) , Self :: Xz => Box :: new ( XzEncoder :: new ( inner , level . into ( ) ) ) , Self :: Zstd => Box :: new ( zstd :: Encoder :: new ( inner , level . into ( ) ) . expect ( " " ) . auto_finish ( ) , ) , } }
Wraps a writer with a compression layer on top.
Wraps a writer with a compression layer on top .
self
inner
W
level
u8
self
inner
W
level
u8