pub struct GzBuilder { /* private fields */ }
Expand description
A builder structure to create a new gzip header.
This structure controls header configuration options such as the filename.
Implementations§
Source§impl GzBuilder
impl GzBuilder
Sourcepub fn extra<T: Into<Vec<u8>>>(self, extra: T) -> GzBuilder
pub fn extra<T: Into<Vec<u8>>>(self, extra: T) -> GzBuilder
Configure the extra
field in the gzip header.
Sourcepub fn filename<T: Into<Vec<u8>>>(self, filename: T) -> GzBuilder
pub fn filename<T: Into<Vec<u8>>>(self, filename: T) -> GzBuilder
Configure the filename
field in the gzip header.
§Panics
Panics if the filename argument contains a byte with the value 0.
Sourcepub fn comment<T: Into<Vec<u8>>>(self, comment: T) -> GzBuilder
pub fn comment<T: Into<Vec<u8>>>(self, comment: T) -> GzBuilder
Configure the comment
field in the gzip header.
§Panics
Panics if the comment argument contains a byte with the value 0.
Sourcepub fn os(self, os: FileSystemType) -> GzBuilder
pub fn os(self, os: FileSystemType) -> GzBuilder
Configure the os
field in the gzip header.
This is taken from std::env::consts::OS
if not set explicitly.
Sourcepub fn xfl(self, xfl: ExtraFlags) -> GzBuilder
pub fn xfl(self, xfl: ExtraFlags) -> GzBuilder
Configure the xfl
field in the gzip header.
The default is ExtraFlags::Default
(meaning not set).
Sourcepub fn into_header_xfl(self, lvl: ExtraFlags) -> Vec<u8>
pub fn into_header_xfl(self, lvl: ExtraFlags) -> Vec<u8>
Transforms this builder structure into a raw vector of bytes, setting the XFL
field to the
value specified by lvl
.
Sourcepub fn into_header(self) -> Vec<u8>
pub fn into_header(self) -> Vec<u8>
Transforms this builder structure into a raw vector of bytes.
Sourcepub fn into_header_with_checksum(self) -> Vec<u8>
pub fn into_header_with_checksum(self) -> Vec<u8>
Transforms this builder structure into a raw vector of bytes.