Struct flate2::GzHeader[][src]

pub struct GzHeader { /* fields omitted */ }

A structure representing the header of a gzip stream.

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

Implementations

impl GzHeader[src]

pub fn filename(&self) -> Option<&[u8]>[src]

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

pub fn extra(&self) -> Option<&[u8]>[src]

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

pub fn comment(&self) -> Option<&[u8]>[src]

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

pub fn operating_system(&self) -> u8[src]

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.

pub fn mtime(&self) -> u32[src]

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.

pub fn mtime_as_datetime(&self) -> Option<SystemTime>[src]

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

impl Clone for GzHeader[src]

impl Debug for GzHeader[src]

impl Default for GzHeader[src]

impl PartialEq<GzHeader> for GzHeader[src]

impl StructuralPartialEq for GzHeader[src]

Auto Trait Implementations

impl RefUnwindSafe for GzHeader

impl Send for GzHeader

impl Sync for GzHeader

impl Unpin for GzHeader

impl UnwindSafe for GzHeader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.