pub struct ZlibEncoder<R> { /* private fields */ }zlib only.Expand description
A zlib 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> ZlibEncoder<R>
impl<R: AsyncBufRead> ZlibEncoder<R>
Sourcepub fn new(inner: R) -> Self
Available on crate feature tokio-02 only.
pub fn new(inner: R) -> Self
tokio-02 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 tokio-02 only.
pub fn with_quality(inner: R, level: Level) -> Self
tokio-02 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 tokio-02 only.
pub fn get_ref(&self) -> &R
tokio-02 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 tokio-02 only.
pub fn get_mut(&mut self) -> &mut R
tokio-02 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 tokio-02 only.
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R>
tokio-02 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 tokio-02 only.
pub fn into_inner(self) -> R
tokio-02 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 ZlibEncoder<R>
Available on crate feature tokio-02 only.
impl<R: AsyncBufRead> AsyncRead for ZlibEncoder<R>
tokio-02 only.Source§fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<usize>>
fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>>
Source§unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>],
) -> bool
unsafe fn prepare_uninitialized_buffer( &self, buf: &mut [MaybeUninit<u8>], ) -> bool
read. Returns
true if the supplied buffer was zeroed out. Read moreSource§impl<R: Debug> Debug for ZlibEncoder<R>
Available on crate feature tokio-02 only.
impl<R: Debug> Debug for ZlibEncoder<R>
tokio-02 only.impl<'__pin, R> Unpin for ZlibEncoder<R>where
PinnedFieldsOf<__Origin<'__pin, R>>: Unpin,
tokio-02 only.Auto Trait Implementations§
impl<R> Freeze for ZlibEncoder<R>where
R: Freeze,
impl<R> RefUnwindSafe for ZlibEncoder<R>where
R: RefUnwindSafe,
impl<R> Send for ZlibEncoder<R>where
R: Send,
impl<R> Sync for ZlibEncoder<R>where
R: Sync,
impl<R> UnsafeUnpin for ZlibEncoder<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for ZlibEncoder<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
Source§fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
buf. Read moreSource§fn read_u8<'a>(&'a mut self) -> ReadU8<&'a mut Self>where
Self: Unpin,
fn read_u8<'a>(&'a mut self) -> ReadU8<&'a mut Self>where
Self: Unpin,
Source§fn read_i8<'a>(&'a mut self) -> ReadI8<&'a mut Self>where
Self: Unpin,
fn read_i8<'a>(&'a mut self) -> ReadI8<&'a mut Self>where
Self: Unpin,
Source§fn read_u16<'a>(&'a mut self) -> ReadU16<&'a mut Self>where
Self: Unpin,
fn read_u16<'a>(&'a mut self) -> ReadU16<&'a mut Self>where
Self: Unpin,
Source§fn read_i16<'a>(&'a mut self) -> ReadI16<&'a mut Self>where
Self: Unpin,
fn read_i16<'a>(&'a mut self) -> ReadI16<&'a mut Self>where
Self: Unpin,
Source§fn read_u32<'a>(&'a mut self) -> ReadU32<&'a mut Self>where
Self: Unpin,
fn read_u32<'a>(&'a mut self) -> ReadU32<&'a mut Self>where
Self: Unpin,
Source§fn read_i32<'a>(&'a mut self) -> ReadI32<&'a mut Self>where
Self: Unpin,
fn read_i32<'a>(&'a mut self) -> ReadI32<&'a mut Self>where
Self: Unpin,
Source§fn read_u64<'a>(&'a mut self) -> ReadU64<&'a mut Self>where
Self: Unpin,
fn read_u64<'a>(&'a mut self) -> ReadU64<&'a mut Self>where
Self: Unpin,
Source§fn read_i64<'a>(&'a mut self) -> ReadI64<&'a mut Self>where
Self: Unpin,
fn read_i64<'a>(&'a mut self) -> ReadI64<&'a mut Self>where
Self: Unpin,
Source§fn read_u128<'a>(&'a mut self) -> ReadU128<&'a mut Self>where
Self: Unpin,
fn read_u128<'a>(&'a mut self) -> ReadU128<&'a mut Self>where
Self: Unpin,
Source§fn read_i128<'a>(&'a mut self) -> ReadI128<&'a mut Self>where
Self: Unpin,
fn read_i128<'a>(&'a mut self) -> ReadI128<&'a mut Self>where
Self: Unpin,
Source§fn read_u16_le<'a>(&'a mut self) -> ReadU16Le<&'a mut Self>where
Self: Unpin,
fn read_u16_le<'a>(&'a mut self) -> ReadU16Le<&'a mut Self>where
Self: Unpin,
Source§fn read_i16_le<'a>(&'a mut self) -> ReadI16Le<&'a mut Self>where
Self: Unpin,
fn read_i16_le<'a>(&'a mut self) -> ReadI16Le<&'a mut Self>where
Self: Unpin,
Source§fn read_u32_le<'a>(&'a mut self) -> ReadU32Le<&'a mut Self>where
Self: Unpin,
fn read_u32_le<'a>(&'a mut self) -> ReadU32Le<&'a mut Self>where
Self: Unpin,
Source§fn read_i32_le<'a>(&'a mut self) -> ReadI32Le<&'a mut Self>where
Self: Unpin,
fn read_i32_le<'a>(&'a mut self) -> ReadI32Le<&'a mut Self>where
Self: Unpin,
Source§fn read_u64_le<'a>(&'a mut self) -> ReadU64Le<&'a mut Self>where
Self: Unpin,
fn read_u64_le<'a>(&'a mut self) -> ReadU64Le<&'a mut Self>where
Self: Unpin,
Source§fn read_i64_le<'a>(&'a mut self) -> ReadI64Le<&'a mut Self>where
Self: Unpin,
fn read_i64_le<'a>(&'a mut self) -> ReadI64Le<&'a mut Self>where
Self: Unpin,
Source§fn read_u128_le<'a>(&'a mut self) -> ReadU128Le<&'a mut Self>where
Self: Unpin,
fn read_u128_le<'a>(&'a mut self) -> ReadU128Le<&'a mut Self>where
Self: Unpin,
Source§fn read_i128_le<'a>(&'a mut self) -> ReadI128Le<&'a mut Self>where
Self: Unpin,
fn read_i128_le<'a>(&'a mut self) -> ReadI128Le<&'a mut Self>where
Self: Unpin,
Source§fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
buf. Read more