Struct async_compression::tokio_03::bufread::GzipEncoder
source · [−]pub struct GzipEncoder<R> { /* private fields */ }
tokio-03
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<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
sourcefn read(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
sourcefn read_buf<B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>where
Self: Unpin,
B: BufMut,
fn read_buf<B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>where
Self: Unpin,
B: BufMut,
sourcefn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
buf
. Read moresourcefn read_u8(&'a mut self) -> ReadU8<&'a mut Self>where
Self: Unpin,
fn read_u8(&'a mut self) -> ReadU8<&'a mut Self>where
Self: Unpin,
sourcefn read_i8(&'a mut self) -> ReadI8<&'a mut Self>where
Self: Unpin,
fn read_i8(&'a mut self) -> ReadI8<&'a mut Self>where
Self: Unpin,
sourcefn read_u16(&'a mut self) -> ReadU16<&'a mut Self>where
Self: Unpin,
fn read_u16(&'a mut self) -> ReadU16<&'a mut Self>where
Self: Unpin,
sourcefn read_i16(&'a mut self) -> ReadI16<&'a mut Self>where
Self: Unpin,
fn read_i16(&'a mut self) -> ReadI16<&'a mut Self>where
Self: Unpin,
sourcefn read_u32(&'a mut self) -> ReadU32<&'a mut Self>where
Self: Unpin,
fn read_u32(&'a mut self) -> ReadU32<&'a mut Self>where
Self: Unpin,
sourcefn read_i32(&'a mut self) -> ReadI32<&'a mut Self>where
Self: Unpin,
fn read_i32(&'a mut self) -> ReadI32<&'a mut Self>where
Self: Unpin,
sourcefn read_u64(&'a mut self) -> ReadU64<&'a mut Self>where
Self: Unpin,
fn read_u64(&'a mut self) -> ReadU64<&'a mut Self>where
Self: Unpin,
sourcefn read_i64(&'a mut self) -> ReadI64<&'a mut Self>where
Self: Unpin,
fn read_i64(&'a mut self) -> ReadI64<&'a mut Self>where
Self: Unpin,
sourcefn read_u128(&'a mut self) -> ReadU128<&'a mut Self>where
Self: Unpin,
fn read_u128(&'a mut self) -> ReadU128<&'a mut Self>where
Self: Unpin,
sourcefn read_i128(&'a mut self) -> ReadI128<&'a mut Self>where
Self: Unpin,
fn read_i128(&'a mut self) -> ReadI128<&'a mut Self>where
Self: Unpin,
sourcefn read_u16_le(&'a mut self) -> ReadU16Le<&'a mut Self>where
Self: Unpin,
fn read_u16_le(&'a mut self) -> ReadU16Le<&'a mut Self>where
Self: Unpin,
sourcefn read_i16_le(&'a mut self) -> ReadI16Le<&'a mut Self>where
Self: Unpin,
fn read_i16_le(&'a mut self) -> ReadI16Le<&'a mut Self>where
Self: Unpin,
sourcefn read_u32_le(&'a mut self) -> ReadU32Le<&'a mut Self>where
Self: Unpin,
fn read_u32_le(&'a mut self) -> ReadU32Le<&'a mut Self>where
Self: Unpin,
sourcefn read_i32_le(&'a mut self) -> ReadI32Le<&'a mut Self>where
Self: Unpin,
fn read_i32_le(&'a mut self) -> ReadI32Le<&'a mut Self>where
Self: Unpin,
sourcefn read_u64_le(&'a mut self) -> ReadU64Le<&'a mut Self>where
Self: Unpin,
fn read_u64_le(&'a mut self) -> ReadU64Le<&'a mut Self>where
Self: Unpin,
sourcefn read_i64_le(&'a mut self) -> ReadI64Le<&'a mut Self>where
Self: Unpin,
fn read_i64_le(&'a mut self) -> ReadI64Le<&'a mut Self>where
Self: Unpin,
sourcefn read_u128_le(&'a mut self) -> ReadU128Le<&'a mut Self>where
Self: Unpin,
fn read_u128_le(&'a mut self) -> ReadU128Le<&'a mut Self>where
Self: Unpin,
sourcefn read_i128_le(&'a mut self) -> ReadI128Le<&'a mut Self>where
Self: Unpin,
fn read_i128_le(&'a mut self) -> ReadI128Le<&'a mut Self>where
Self: Unpin,
sourcefn read_to_end(&'a mut self, buf: &'a mut Vec<u8, Global>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end(&'a mut self, buf: &'a mut Vec<u8, Global>) -> ReadToEnd<'a, Self>where
Self: Unpin,
buf
. Read moresourcefn read_to_string(&'a mut self, dst: &'a mut String) -> ReadToString<'a, Self>where
Self: Unpin,
fn read_to_string(&'a mut self, dst: &'a mut String) -> ReadToString<'a, Self>where
Self: Unpin,
buf
. Read more