Struct flate2::GzBuilder [-] [+] [src]

pub struct GzBuilder {
    // some fields omitted
}

A builder structure to create a new gzip Encoder.

This structure controls header configuration options such as the filename.

Methods

impl Builder

fn new() -> Builder

Create a new blank builder with no header by default.

fn mtime(self, mtime: u32) -> Builder

Configure the mtime field in the gzip header.

fn extra(self, extra: Vec<u8>) -> Builder

Configure the extra field in the gzip header.

fn filename(self, filename: &[u8]) -> Builder

Configure the filename field in the gzip header.

fn comment(self, comment: &[u8]) -> Builder

Configure the comment field in the gzip header.

fn write<W: Write>(self, w: W, lvl: Compression) -> EncoderWriter<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) -> EncoderReader<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.