Struct flate2::GzHeader

source ·
pub struct GzHeader {
    extra: Option<Vec<u8>>,
    filename: Option<Vec<u8>>,
    comment: Option<Vec<u8>>,
    operating_system: u8,
    mtime: u32,
}
Expand description

A structure representing the header of a gzip stream.

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

Fields

extra: Option<Vec<u8>>filename: Option<Vec<u8>>comment: Option<Vec<u8>>operating_system: u8mtime: u32

Implementations

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

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

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

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

There are predefined values for various operating systems. 255 means that the value is unknown.

This gives the most recent modification time of the original file being compressed.

The time is in Unix format, i.e., seconds since 00:00:00 GMT, Jan. 1, 1970. (Note that this may cause problems for MS-DOS and other systems that use local rather than Universal time.) If the compressed data did not come from a file, mtime is set to the time at which compression started. mtime = 0 means no time stamp is available.

The usage of mtime is discouraged because of Year 2038 problem.

Returns the most recent modification time represented by a date-time type. Returns None if the value of the underlying counter is 0, indicating no time stamp is available.

The time is measured as seconds since 00:00:00 GMT, Jan. 1 1970. See mtime for more detail.

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
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.