Struct async_compression::tokio_02::bufread::DeflateDecoder
source · [−]pub struct DeflateDecoder<R> { /* private fields */ }
tokio-02
and deflate
only.Expand description
A deflate decoder, or decompressor.
This structure implements an AsyncRead
interface and will
read compressed data from an underlying stream and emit a stream of uncompressed data.
Implementations
sourceimpl<R: AsyncBufRead> DeflateDecoder<R>
impl<R: AsyncBufRead> DeflateDecoder<R>
sourcepub fn new(read: R) -> DeflateDecoder<R>
pub fn new(read: R) -> DeflateDecoder<R>
Creates a new decoder which will read compressed data from the given stream and emit a uncompressed stream.
sourcepub fn multiple_members(&mut self, enabled: bool)
pub fn multiple_members(&mut self, enabled: bool)
Configure multi-member/frame decoding, if enabled this will reset the decoder state when reaching the end of a compressed member/frame and expect either EOF or another compressed member/frame to follow it in the stream.
sourcepub fn get_ref(&self) -> &R
pub fn get_ref(&self) -> &R
Acquires a reference to the underlying reader that this decoder 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 decoder is wrapping.
Note that care must be taken to avoid tampering with the state of the reader which may otherwise confuse this decoder.
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 decoder is wrapping.
Note that care must be taken to avoid tampering with the state of the reader which may otherwise confuse this decoder.
sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Consumes this decoder returning the underlying reader.
Note that this may discard internal state of this decoder, so care should be taken to avoid losing resources when this is called.
Trait Implementations
sourceimpl<R: AsyncBufRead> AsyncRead for DeflateDecoder<R>
impl<R: AsyncBufRead> AsyncRead for DeflateDecoder<R>
sourcefn 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>>
sourceunsafe 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 moresourceimpl<R: Debug> Debug for DeflateDecoder<R>
impl<R: Debug> Debug for DeflateDecoder<R>
impl<'__pin, R> Unpin for DeflateDecoder<R>where
__Origin<'__pin, R>: Unpin,
Auto Trait Implementations
impl<R> RefUnwindSafe for DeflateDecoder<R>where
R: RefUnwindSafe,
impl<R> Send for DeflateDecoder<R>where
R: Send,
impl<R> Sync for DeflateDecoder<R>where
R: Sync,
impl<R> UnwindSafe for DeflateDecoder<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