Struct async_compression::futures::bufread::GzipEncoder
source · [−]pub struct GzipEncoder<R> { /* private fields */ }
futures-io
and gzip
only.Expand description
A gzip 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
sourceimpl<R: AsyncBufRead> GzipEncoder<R>
impl<R: AsyncBufRead> GzipEncoder<R>
sourcepub fn new(inner: R) -> Self
pub fn new(inner: R) -> Self
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
pub fn with_quality(inner: R, level: Level) -> Self
Creates a new encoder which will read uncompressed data from the given stream and emit a compressed stream.
sourcepub fn get_ref(&self) -> &R
pub fn get_ref(&self) -> &R
Acquires a reference to the underlying reader that this encoder is wrapping.
sourcepub fn get_mut(&mut self) -> &mut R
pub fn get_mut(&mut self) -> &mut R
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>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>
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
pub fn into_inner(self) -> R
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
sourceimpl<R: AsyncBufRead> AsyncRead for GzipEncoder<R>
impl<R: AsyncBufRead> AsyncRead for GzipEncoder<R>
sourceimpl<R: Debug> Debug for GzipEncoder<R>
impl<R: Debug> Debug for GzipEncoder<R>
impl<'__pin, R> Unpin for GzipEncoder<R> where
__Origin<'__pin, R>: Unpin,
Auto Trait Implementations
impl<R> RefUnwindSafe for GzipEncoder<R> where
R: RefUnwindSafe,
impl<R> Send for GzipEncoder<R> where
R: Send,
impl<R> Sync for GzipEncoder<R> where
R: Sync,
impl<R> UnwindSafe for GzipEncoder<R> where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more