[−][src]Struct gzip_header::GzHeader
A structure representing the raw header of a gzip stream.
The header can contain metadata about the file that was compressed, if present.
Methods
impl GzHeader
[src]
pub fn filename(&self) -> Option<&[u8]>
[src]
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.
pub fn extra(&self) -> Option<&[u8]>
[src]
Returns the extra
field of this gzip header, if present.
pub fn comment(&self) -> Option<&[u8]>
[src]
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.
pub fn mtime(&self) -> u32
[src]
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.
pub fn mtime_as_datetime(&self) -> Option<SystemTime>
[src]
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.
pub fn os(&self) -> u8
[src]
Returns the os
field of this gzip stream's header.
pub fn xfl(&self) -> u8
[src]
Returns the xfl
field of this gzip stream's header.
Trait Implementations
impl Eq for GzHeader
[src]
impl Clone for GzHeader
[src]
fn clone(&self) -> GzHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<GzHeader> for GzHeader
[src]
impl Display for GzHeader
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
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.
impl Debug for GzHeader
[src]
impl Hash for GzHeader
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,