pub struct GzHeader { /* private fields */ }
Expand description
A structure representing the header of a gzip stream.
The header can contain metadata about the file that was compressed, if present.
Implementations
sourceimpl GzHeader
impl GzHeader
sourcepub fn filename(&self) -> Option<&[u8]>
pub fn filename(&self) -> Option<&[u8]>
Returns the filename
field of this gzip stream’s header, if present.
sourcepub fn extra(&self) -> Option<&[u8]>
pub fn extra(&self) -> Option<&[u8]>
Returns the extra
field of this gzip stream’s header, if present.
sourcepub fn comment(&self) -> Option<&[u8]>
pub fn comment(&self) -> Option<&[u8]>
Returns the comment
field of this gzip stream’s header, if present.
sourcepub fn operating_system(&self) -> u8
pub 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.
sourcepub fn mtime(&self) -> u32
pub 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.
sourcepub fn mtime_as_datetime(&self) -> Option<SystemTime>
pub 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 StructuralPartialEq for GzHeader
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more