Struct async_compression::tokio::bufread::BzDecoder
source · pub struct BzDecoder<R> { /* private fields */ }
Expand description
A bzip2 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§
source§impl<R: AsyncBufRead> BzDecoder<R>
impl<R: AsyncBufRead> BzDecoder<R>
sourcepub fn new(read: R) -> BzDecoder<R>
pub fn new(read: R) -> BzDecoder<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§
source§impl<R: AsyncBufRead> AsyncRead for BzDecoder<R>
impl<R: AsyncBufRead> AsyncRead for BzDecoder<R>
impl<'__pin, R> Unpin for BzDecoder<R>where
__Origin<'__pin, R>: Unpin,
Auto Trait Implementations§
impl<R> Freeze for BzDecoder<R>where
R: Freeze,
impl<R> RefUnwindSafe for BzDecoder<R>where
R: RefUnwindSafe,
impl<R> Send for BzDecoder<R>where
R: Send,
impl<R> Sync for BzDecoder<R>where
R: Sync,
impl<R> UnwindSafe for BzDecoder<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(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
source§fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
source§fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
source§fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
source§fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
source§fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
source§fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
source§fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
source§fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
source§fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
source§fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
source§fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
source§fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
source§fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
source§fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
source§fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
source§fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
source§fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
source§fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
source§fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
source§fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
source§fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
fn read_f64_le(&mut self) -> ReadF64Le<&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