Struct gzip_header::GzHeader[][src]

pub struct GzHeader { /* fields omitted */ }
Expand description

A structure representing the raw header of a gzip stream.

The header can contain metadata about the file that was compressed, if present.

Implementations

Returns the filename field of this gzip header, if present.

The filename field the gzip header is supposed to be stored using ISO 8859-1 (LATIN-1) encoding and be zero-terminated if following the specification.

Returns the extra field of this gzip header, if present.

Returns the comment field of this gzip stream’s header, if present.

The comment field in the gzip header is supposed to be stored using ISO 8859-1 (LATIN-1) encoding and be zero-terminated if following the specification.

Returns the mtime field of this gzip header.

This gives the most recent modification time of the contained file, or alternatively the timestamp of when the file was compressed if the data did not come from a file, or a timestamp was not available when compressing. The time is specified the Unix format, that is: seconds since 00:00:00 GMT, Jan. 1, 1970. (Not that this may cause problems for MS-DOS and other systems that use local rather than Universal time.) An mtime value of 0 means that the timestamp is not set.

Returns the mtime field of this gzip header as a SystemTime if present.

Returns None if the mtime is not set, i.e 0. See mtime for more detail.

Returns the os field of this gzip stream’s header.

Returns the xfl field of this gzip stream’s header.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Crudely display the contents of the header

Note that filename/commend are required to be ISO 8859-1 (LATIN-1) encoded by the spec, however to avoid dragging in dependencies we simply interpret them as UTF-8. This may result in garbled output if the names contain special characters.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.