Struct MultiGzDecoder
struct MultiGzDecoder<W: Write> { ... }
A gzip streaming decoder that decodes a gzip file with multiple members.
This structure exposes a Write interface that will consume compressed data and
write uncompressed data to the underlying writer.
A gzip file consists of a series of members concatenated one after another.
MultiGzDecoder decodes all members of a file and writes them to the
underlying writer one after another.
To handle members separately, see [GzDecoder] or read more in the introduction.
Implementations
impl<W: Write> MultiGzDecoder<W>
fn new(w: W) -> MultiGzDecoder<W>Creates a new decoder which will write uncompressed data to the stream. If the gzip stream contains multiple members all will be decoded.
fn header(self: &Self) -> Option<&GzHeader>Returns the header associated with the current member.
fn get_ref(self: &Self) -> &WAcquires a reference to the underlying writer.
fn get_mut(self: &mut Self) -> &mut WAcquires a mutable reference to the underlying writer.
Note that mutating the output/input state of the stream may corrupt this object, so care must be taken when using this method.
fn try_finish(self: &mut Self) -> Result<()>Attempt to finish this output stream, writing out final chunks of data.
Note that this function can only be used once data has finished being written to the output stream. After this function is called then further calls to
writemay result in a panic.Panics
Attempts to write data to this stream may result in a panic after this function is called.
Errors
This function will perform I/O to finish the stream, returning any errors which happen.
fn finish(self: Self) -> Result<W>Consumes this decoder, flushing the output stream.
This will flush the underlying data stream and then return the contained writer if the flush succeeded.
Note that this function may not be suitable to call in a situation where the underlying stream is an asynchronous I/O stream. To finish a stream the
try_finish(orshutdown) method should be used instead. To re-acquire ownership of a stream it is safe to call this method aftertry_finishorshutdownhas returnedOk.Errors
This function will perform I/O to complete this stream, and any I/O errors which occur will be returned from this function.
impl<T> Any for MultiGzDecoder<W>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for MultiGzDecoder<W>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for MultiGzDecoder<W>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for MultiGzDecoder<W>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for MultiGzDecoder<W>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for MultiGzDecoder<W>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for MultiGzDecoder<W>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<W> Freeze for MultiGzDecoder<W>
impl<W> RefUnwindSafe for MultiGzDecoder<W>
impl<W> Send for MultiGzDecoder<W>
impl<W> Sync for MultiGzDecoder<W>
impl<W> Unpin for MultiGzDecoder<W>
impl<W> UnsafeUnpin for MultiGzDecoder<W>
impl<W> UnwindSafe for MultiGzDecoder<W>
impl<W: $crate::fmt::Debug + Write> Debug for MultiGzDecoder<W>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<W: Write> Write for MultiGzDecoder<W>
fn write(self: &mut Self, buf: &[u8]) -> Result<usize>fn flush(self: &mut Self) -> Result<()>