pub struct ZstdEncoder<R> { /* private fields */ }zstd only.Expand description
A zstd encoder, or compressor.
This structure implements an AsyncRead interface and will
read uncompressed data from an underlying stream and emit a stream of compressed data.
Implementations§
Source§impl<R: AsyncBufRead> ZstdEncoder<R>
impl<R: AsyncBufRead> ZstdEncoder<R>
Sourcepub fn new(inner: R) -> Self
Available on crate feature futures-io only.
pub fn new(inner: R) -> Self
futures-io only.Creates a new encoder which will read uncompressed data from the given stream and emit a compressed stream.
Sourcepub fn with_quality(inner: R, level: Level) -> Self
Available on crate feature futures-io only.
pub fn with_quality(inner: R, level: Level) -> Self
futures-io only.Creates a new encoder which will read uncompressed data from the given stream and emit a compressed stream.
Sourcepub fn get_ref(&self) -> &R
Available on crate feature futures-io only.
pub fn get_ref(&self) -> &R
futures-io only.Acquires a reference to the underlying reader that this encoder is wrapping.
Sourcepub fn get_mut(&mut self) -> &mut R
Available on crate feature futures-io only.
pub fn get_mut(&mut self) -> &mut R
futures-io only.Acquires a mutable reference to the underlying reader that this encoder is wrapping.
Note that care must be taken to avoid tampering with the state of the reader which may otherwise confuse this encoder.
Sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>
Available on crate feature futures-io only.
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>
futures-io only.Acquires a pinned mutable reference to the underlying reader that this encoder is wrapping.
Note that care must be taken to avoid tampering with the state of the reader which may otherwise confuse this encoder.
Sourcepub fn into_inner(self) -> R
Available on crate feature futures-io only.
pub fn into_inner(self) -> R
futures-io only.Consumes this encoder returning the underlying reader.
Note that this may discard internal state of this encoder, so care should be taken to avoid losing resources when this is called.
Trait Implementations§
Source§impl<R: AsyncBufRead> AsyncRead for ZstdEncoder<R>
Available on crate feature futures-io only.
impl<R: AsyncBufRead> AsyncRead for ZstdEncoder<R>
futures-io only.Source§impl<R: Debug> Debug for ZstdEncoder<R>
Available on crate feature futures-io only.
impl<R: Debug> Debug for ZstdEncoder<R>
futures-io only.impl<'__pin, R> Unpin for ZstdEncoder<R>where
PinnedFieldsOf<__Origin<'__pin, R>>: Unpin,
futures-io only.