[][src]Struct tar::GnuHeader

#[repr(C)]
pub struct GnuHeader { pub name: [u8; 100], pub mode: [u8; 8], pub uid: [u8; 8], pub gid: [u8; 8], pub size: [u8; 12], pub mtime: [u8; 12], pub cksum: [u8; 8], pub typeflag: [u8; 1], pub linkname: [u8; 100], pub magic: [u8; 6], pub version: [u8; 2], pub uname: [u8; 32], pub gname: [u8; 32], pub dev_major: [u8; 8], pub dev_minor: [u8; 8], pub atime: [u8; 12], pub ctime: [u8; 12], pub offset: [u8; 12], pub longnames: [u8; 4], pub unused: [u8; 1], pub sparse: [GnuSparseHeader; 4], pub isextended: [u8; 1], pub realsize: [u8; 12], pub pad: [u8; 17], }

Representation of the header of an entry in an archive

Fields

name: [u8; 100]mode: [u8; 8]uid: [u8; 8]gid: [u8; 8]size: [u8; 12]mtime: [u8; 12]cksum: [u8; 8]typeflag: [u8; 1]linkname: [u8; 100]magic: [u8; 6]version: [u8; 2]uname: [u8; 32]gname: [u8; 32]dev_major: [u8; 8]dev_minor: [u8; 8]atime: [u8; 12]ctime: [u8; 12]offset: [u8; 12]longnames: [u8; 4]unused: [u8; 1]sparse: [GnuSparseHeader; 4]isextended: [u8; 1]realsize: [u8; 12]pad: [u8; 17]

Methods

impl GnuHeader[src]

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

See Header::username_bytes

pub fn set_username(&mut self, name: &str) -> Result<()>[src]

See Header::set_username

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

See Header::groupname_bytes

pub fn set_groupname(&mut self, name: &str) -> Result<()>[src]

See Header::set_groupname

pub fn device_major(&self) -> Result<u32>[src]

See Header::device_major

pub fn set_device_major(&mut self, major: u32)[src]

See Header::set_device_major

pub fn device_minor(&self) -> Result<u32>[src]

See Header::device_minor

pub fn set_device_minor(&mut self, minor: u32)[src]

See Header::set_device_minor

pub fn atime(&self) -> Result<u64>[src]

Returns the last modification time in Unix time format

pub fn set_atime(&mut self, atime: u64)[src]

Encodes the atime provided into this header.

Note that this time is typically a number of seconds passed since January 1, 1970.

pub fn ctime(&self) -> Result<u64>[src]

Returns the last modification time in Unix time format

pub fn set_ctime(&mut self, ctime: u64)[src]

Encodes the ctime provided into this header.

Note that this time is typically a number of seconds passed since January 1, 1970.

pub fn real_size(&self) -> Result<u64>[src]

Returns the "real size" of the file this header represents.

This is applicable for sparse files where the returned size here is the size of the entire file after the sparse regions have been filled in.

pub fn is_extended(&self) -> bool[src]

Indicates whether this header will be followed by additional sparse-header records.

Note that this is handled internally by this library, and is likely only interesting if a raw iterator is being used.

pub fn as_header(&self) -> &Header[src]

Views this as a normal Header

pub fn as_header_mut(&mut self) -> &mut Header[src]

Views this as a normal Header

Trait Implementations

impl Debug for GnuHeader[src]

Auto Trait Implementations

impl Send for GnuHeader

impl Sync for GnuHeader

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.