Struct GzBuilder
pub struct GzBuilder { /* private fields */ }
A builder structure to create a new gzip Encoder.
This structure controls header configuration options such as the filename.
Examples
use *;
# use io;
use File;
use GzBuilder;
use Compression;
// GzBuilder opens a file and writes a sample string using GzBuilder pattern
#
Implementations
impl GzBuilder
fn new() -> GzBuilderCreate a new blank builder with no header by default.
fn mtime(self, mtime: u32) -> GzBuilderConfigure the
mtimefield in the gzip header.fn operating_system(self, os: u8) -> GzBuilderConfigure the
operating_systemfield in the gzip header.fn extra<T: Into<Vec<u8>>>(self, extra: T) -> GzBuilderConfigure the
extrafield in the gzip header.fn filename<T: Into<Vec<u8>>>(self, filename: T) -> GzBuilderConfigure the
filenamefield in the gzip header.Panics
Panics if the
filenameslice contains a zero.fn comment<T: Into<Vec<u8>>>(self, comment: T) -> GzBuilderConfigure the
commentfield in the gzip header.Panics
Panics if the
commentslice contains a zero.fn write<W: Write>(self, w: W, lvl: Compression) -> GzEncoder<W>Consume this builder, creating a writer encoder in the process.
The data written to the returned encoder will be compressed and then written out to the supplied parameter
w.fn read<R: Read>(self, r: R, lvl: Compression) -> GzEncoder<R>Consume this builder, creating a reader encoder in the process.
Data read from the returned encoder will be the compressed version of the data read from the given reader.
fn buf_read<R>(self, r: R, lvl: Compression) -> GzEncoder<R> where R: BufRead,Consume this builder, creating a reader encoder in the process.
Data read from the returned encoder will be the compressed version of the data read from the given reader.
Trait Implementations
impl Debug for GzBuilder
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for GzBuilder
fn default() -> GzBuilder
Auto Trait Implementations
impl Freeze for GzBuilder
impl RefUnwindSafe for GzBuilder
impl Send for GzBuilder
impl Sync for GzBuilder
impl Unpin for GzBuilder
impl UnsafeUnpin for GzBuilder
impl UnwindSafe for GzBuilder
Blanket Implementations
impl<T> Any for GzBuilder
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for GzBuilder
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for GzBuilder
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for GzBuilder
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for GzBuilder
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 GzBuilder
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for GzBuilder
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>