Struct GzHeader

pub struct GzHeader { /* private fields */ }

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

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

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

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

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

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

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

fn operating_system(&self) -> u8

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.

fn mtime(&self) -> u32

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.

fn mtime_as_datetime(&self) -> Option<SystemTime>

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

fn clone(&self) -> GzHeader

impl Debug for GzHeader

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for GzHeader

fn default() -> GzHeader

impl PartialEq for GzHeader

fn eq(&self, other: &GzHeader) -> bool

impl StructuralPartialEq for GzHeader

Auto Trait Implementations

impl Freeze for GzHeader

impl RefUnwindSafe for GzHeader

impl Send for GzHeader

impl Sync for GzHeader

impl Unpin for GzHeader

impl UnsafeUnpin for GzHeader

impl UnwindSafe for GzHeader

Blanket Implementations

impl<T> Any for GzHeader where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for GzHeader where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for GzHeader where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for GzHeader where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for GzHeader

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for GzHeader where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for GzHeader where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for GzHeader where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for GzHeader where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>