pub struct Header {
pub path: String,
pub mode: Option<u64>,
pub uid: Option<u64>,
pub gid: Option<u64>,
pub size: u64,
pub mtime: Option<u64>,
pub typeflag: u8,
pub linkname: Option<String>,
}Expand description
A tar header
Fields§
§path: StringThe record’s path and name
mode: Option<u64>The record’s access mode bits (e.g. 0o777)
uid: Option<u64>The record’s UID
gid: Option<u64>The record’s GID
size: u64The record’s size
mtime: Option<u64>The record’s modification time
typeflag: u8The record’s type
linkname: Option<String>The record’s link name
Implementations§
Source§impl Header
impl Header
Sourcepub fn parse(data: Raw) -> Result<Self, BasicTarError>
pub fn parse(data: Raw) -> Result<Self, BasicTarError>
Parses a raw byte block into a classic tar header
Sourcepub fn serialize(self) -> Result<Raw, BasicTarError>
pub fn serialize(self) -> Result<Raw, BasicTarError>
Serializes the tar header into a raw byte block
Note: this function can fail because the struct may contain values that cannot be serialized, e.g. a name longer than 100 bytes or a size greater than 8 GiB
Trait Implementations§
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more