pub struct FileEntry<'a, B: Backend>(/* private fields */);
Expand description
A file entry of the archive.
An instance of this type is attached to the Entry::File
variant and
provides file specific options.
One of the read*
methods can be used to get the content of the file.
Implementations§
Source§impl<'a, B: Backend> FileEntry<'a, B>
impl<'a, B: Backend> FileEntry<'a, B>
Sourcepub fn can_read(&self, group: Group) -> bool
pub fn can_read(&self, group: Group) -> bool
Tests whether a member of the given group
has read access.
Sourcepub fn can_write(&self, group: Group) -> bool
pub fn can_write(&self, group: Group) -> bool
Tests whether a member of the given group
has write access.
Sourcepub fn can_execute(&self, group: Group) -> bool
pub fn can_execute(&self, group: Group) -> bool
Tests whether a member of the given group
has execute access.
Sourcepub fn appended(&self) -> &DateTime<Utc>
pub fn appended(&self) -> &DateTime<Utc>
Returns the time when the entry was appened to the archive.
Sourcepub fn created(&self) -> &DateTime<Utc>
pub fn created(&self) -> &DateTime<Utc>
Returns the time when the originating filesystem entry was created.
Sourcepub fn changed(&self) -> &DateTime<Utc>
pub fn changed(&self) -> &DateTime<Utc>
Returns the time when the originating filesystem entry was changed the last time.
Sourcepub fn modified(&self) -> &DateTime<Utc>
pub fn modified(&self) -> &DateTime<Utc>
Returns the time when the originating filesystem entry was modified the last time.
Sourcepub fn read(&mut self, buf: &mut [u8]) -> ArchiveResult<usize, B>
pub fn read(&mut self, buf: &mut [u8]) -> ArchiveResult<usize, B>
Sourcepub fn read_all(&mut self, buf: &mut [u8]) -> ArchiveResult<(), B>
pub fn read_all(&mut self, buf: &mut [u8]) -> ArchiveResult<(), B>
Read the exact number of bytes required to fill buf
This function reads as many bytes as necessary to completely fill the
specified buffer buf
.
§Errors
If this function encounters an “end of file” before completely filling
the buffer, it returns an Error::UnexpectedEof
error. The contents
of buf
are unspecified in this case.