Skip to main content

Header

Struct Header 

Source
pub struct Header { /* private fields */ }
Expand description

Parsed metadata for a tar header.

Implementations§

Source§

impl Header

Source

pub fn new_gnu(entry_type: EntryType) -> Self

Creates a deterministic GNU-format header for entry_type.

Numeric fields default to zero. Callers must set the entry size before appending regular-file data. Paths and checksums are populated by Builder.

Source

pub const fn mode(&self) -> u32

File mode from the header.

Source

pub const fn uid(&self) -> u64

User id from the header.

Source

pub const fn gid(&self) -> u64

Group id from the header.

Source

pub const fn stored_size(&self) -> u64

Raw stored size before sparse expansion.

Source

pub const fn mtime(&self) -> i64

Modification time as seconds since the Unix epoch.

Source

pub const fn type_flag(&self) -> u8

Raw tar type flag.

Source

pub const fn set_mode(&mut self, mode: u32)

Sets the file mode stored in the header.

Source

pub const fn set_uid(&mut self, uid: u64)

Sets the numeric user id stored in the header.

Source

pub const fn set_gid(&mut self, gid: u64)

Sets the numeric group id stored in the header.

Source

pub const fn set_size(&mut self, size: u64)

Sets the number of data bytes that follow the header.

Source

pub const fn set_mtime(&mut self, mtime: i64)

Sets the modification time as seconds since the Unix epoch.

Link target, when present.

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Header

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Header

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.