pub struct TarballEntry<'a, 'c> {
path: PathBuf,
entry: Entry<'a, CompressionDecoder<'c>>,
}
Expand description
An entry in a tarball.
Fields§
§path: PathBuf
The path of the entry in the archive.
entry: Entry<'a, CompressionDecoder<'c>>
The raw tar entry.
Implementations§
Source§impl<'a, 'c> TarballEntry<'a, 'c>
impl<'a, 'c> TarballEntry<'a, 'c>
Sourcepub fn is_dir(&self) -> bool
pub fn is_dir(&self) -> bool
Checks whether the TarballEntry
represents a directory.
Returns true
if the TarballEntry
represents a directory, false
otherwise.
§Note
This is a convenience method for comparing the EntryType
of the Entry::header
contained in the TarballEntry
with EntryType::Directory
.
Sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Checks whether the TarballEntry
represents a regular file.
Returns true
if the TarballEntry
represents a regular file, false
otherwise.
§Note
This is a convenience method for comparing the EntryType
of the Entry::header
contained in the TarballEntry
with EntryType::Regular
.
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Checks whether the TarballEntry
represents a symlink.
Returns true
if the TarballEntry
represents a symlink, false
otherwise.
§Note
This is a convenience method for comparing the EntryType
of the Entry::header
contained in the TarballEntry
with EntryType::Symlink
.
Sourcepub fn permissions(&self) -> Result<u32, Error>
pub fn permissions(&self) -> Result<u32, Error>
Returns the access permissions that apply for the TarballEntry
.
§Notes
- This is a convenience method for retrieving the mode of the
Entry::header
contained in theTarballEntry
. - It returns the mode masked with
0o7777
to ensure only the permission bits are returned.
§Errors
Returns an error if retrieving the mode from the entry’s header fails.
Sourcepub fn raw(&self) -> &Entry<'a, CompressionDecoder<'c>>
pub fn raw(&self) -> &Entry<'a, CompressionDecoder<'c>>
Returns a reference to the underlying tar Entry
.
This is useful for accessing metadata of the entry, such as its header or path.
Trait Implementations§
Source§impl Debug for TarballEntry<'_, '_>
impl Debug for TarballEntry<'_, '_>
Source§impl Read for TarballEntry<'_, '_>
impl Read for TarballEntry<'_, '_>
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
Reads data from the entry into the provided buffer.
Delegates to Entry::read
.
§Errors
Returns an error if reading from the entry fails.
1.36.0 · Source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read
, except that it reads into a slice of buffers. Read moreSource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)1.0.0 · Source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf
. Read more1.0.0 · Source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf
. Read more1.6.0 · Source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf
. Read moreSource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)Source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)cursor
. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read
. Read more