Struct BzDecoder
pub struct BzDecoder<R> { /* private fields */ }
A bz2 decoder, or decompressor.
This structure implements a BufRead interface and takes a stream of
compressed data as input, providing the decompressed data when read from.
Implementations
impl<R> BzDecoder<R>
fn get_ref(&self) -> &RAcquires a reference to the underlying stream
fn get_mut(&mut self) -> &mut RAcquires a mutable reference to the underlying stream
Note that mutation of the stream may result in surprising results if this encoder is continued to be used.
fn into_inner(self) -> RConsumes this decoder, returning the underlying reader.
fn total_in(&self) -> u64Returns the number of bytes that the decompressor has consumed.
Note that this will likely be smaller than what the decompressor actually read from the underlying stream due to buffering.
fn total_out(&self) -> u64Returns the number of bytes that the decompressor has produced.
impl<R: BufRead> BzDecoder<R>
fn new(r: R) -> SelfCreates a new decoder which will decompress data read from the given stream.
Trait Implementations
impl<R: BufRead> Read for BzDecoder<R>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
impl<W: Write> Write for BzDecoder<W>
fn write(&mut self, buf: &[u8]) -> Result<usize>fn flush(&mut self) -> Result<()>
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> Unpin for BzDecoder<R>
where
R: Unpin,
impl<R> UnsafeUnpin for BzDecoder<R>
where
R: UnsafeUnpin,
impl<R> UnwindSafe for BzDecoder<R>
where
R: UnwindSafe,
Blanket Implementations
impl<T> Any for BzDecoder<R>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for BzDecoder<R>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for BzDecoder<R>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for BzDecoder<R>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for BzDecoder<R>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for BzDecoder<R>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for BzDecoder<R>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>