Struct nuts_archive::FileEntry
source · 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.