pub struct ParsedEntry<'a> {Show 15 fields
pub header: &'a Header,
pub entry_type: EntryType,
pub path: Cow<'a, [u8]>,
pub link_target: Option<Cow<'a, [u8]>>,
pub mode: u32,
pub uid: u64,
pub gid: u64,
pub mtime: u64,
pub size: u64,
pub uname: Option<Cow<'a, [u8]>>,
pub gname: Option<Cow<'a, [u8]>>,
pub dev_major: Option<u32>,
pub dev_minor: Option<u32>,
pub xattrs: Vec<(Cow<'a, [u8]>, Cow<'a, [u8]>)>,
pub pax: Option<&'a [u8]>,
}Expand description
A fully-resolved tar entry with all extensions applied.
Borrowed data comes from the input slice, so the entry is valid only as long as the input buffer is live.
Fields§
§header: &'a HeaderThe raw 512-byte header.
entry_type: EntryTypeThe entry type (Regular, Directory, Symlink, etc.).
path: Cow<'a, [u8]>The resolved file path.
Priority: PAX path > GNU long name > header name (+ UStar prefix).
link_target: Option<Cow<'a, [u8]>>The resolved link target (for symlinks and hardlinks).
Priority: PAX linkpath > GNU long link > header linkname.
mode: u32File mode/permissions.
uid: u64Owner UID.
gid: u64Owner GID.
mtime: u64Modification time as Unix timestamp.
size: u64Content size in bytes.
uname: Option<Cow<'a, [u8]>>User name.
gname: Option<Cow<'a, [u8]>>Group name.
dev_major: Option<u32>Device major number (for block/char devices).
dev_minor: Option<u32>Device minor number (for block/char devices).
xattrs: Vec<(Cow<'a, [u8]>, Cow<'a, [u8]>)>Extended attributes from PAX SCHILY.xattr.* entries.
pax: Option<&'a [u8]>Raw PAX extended header data, if a PAX 'x' entry preceded this entry.
This is the unprocessed content of the PAX extension entry, preserved
so that callers can iterate all PAX key-value pairs (not just the ones
tar-core resolves into struct fields). Parse it with
PaxExtensions::new.
Implementations§
Source§impl<'a> ParsedEntry<'a>
impl<'a> ParsedEntry<'a>
Sourcepub fn path_lossy(&self) -> Cow<'_, str>
pub fn path_lossy(&self) -> Cow<'_, str>
Get the path as a lossy UTF-8 string.
Sourcepub fn link_target_lossy(&self) -> Option<Cow<'_, str>>
pub fn link_target_lossy(&self) -> Option<Cow<'_, str>>
Get the link target as a lossy UTF-8 string, if present.
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Check if this is a symbolic link.
Sourcepub fn is_hard_link(&self) -> bool
pub fn is_hard_link(&self) -> bool
Check if this is a hard link.
Sourcepub fn padded_size(&self) -> u64
pub fn padded_size(&self) -> u64
Get the padded size (rounded up to block boundary).