Enum nuts_archive::Entry
source · pub enum Entry<'a, B: Backend> {
File(FileEntry<'a, B>),
Directory(DirectoryEntry<'a, B>),
Symlink(SymlinkEntry<'a, B>),
}Expand description
An entry of the archive.
An instance of Entry represents an entry of the archive.
You can traverse through the archive using the Entry::next() method.
The first entry of the archive is returned by
Archive::first().
Variants§
File(FileEntry<'a, B>)
The entry represents a file.
Directory(DirectoryEntry<'a, B>)
The entry represents a directory.
Symlink(SymlinkEntry<'a, B>)
The entry represents a symlink.
Implementations§
source§impl<'a, B: Backend> Entry<'a, B>
impl<'a, B: Backend> Entry<'a, B>
sourcepub fn next(self) -> Option<ArchiveResult<Entry<'a, B>, B>>
pub fn next(self) -> Option<ArchiveResult<Entry<'a, B>, B>>
Returns the next entry in the archive.
If this is the last entry None is returned, which means that there
are no further entries available.
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 is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
Tests whether this entry represents a directory.
sourcepub fn as_directory(&self) -> Option<&DirectoryEntry<'a, B>>
pub fn as_directory(&self) -> Option<&DirectoryEntry<'a, B>>
Returns a reference to the inner DirectoryEntry instance if this
entry represents a directory.
If this entry is a directory then a reference to the inner
DirectoryEntry wrapped into a Some is returned. If this is not
a directory None is returned.
sourcepub fn into_directory(self) -> Option<DirectoryEntry<'a, B>>
pub fn into_directory(self) -> Option<DirectoryEntry<'a, B>>
Returns the inner DirectoryEntry instance if this entry represents
a directory.
If this entry is a directory then the inner DirectoryEntry wrapped
into a Some is returned. If this is not a directory None is
returned.
sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Tests whether this entry represents a symlink.
sourcepub fn as_symlink(&self) -> Option<&SymlinkEntry<'a, B>>
pub fn as_symlink(&self) -> Option<&SymlinkEntry<'a, B>>
Returns a reference to the inner SymlinkEntry instance if this
entry represents a symlink.
If this entry is a symlink then a reference to the inner
SymlinkEntry wrapped into a Some is returned. If this is not a
symlink None is returned.
sourcepub fn into_symlink(self) -> Option<SymlinkEntry<'a, B>>
pub fn into_symlink(self) -> Option<SymlinkEntry<'a, B>>
Returns the inner SymlinkEntry instance if this entry represents a
symlink.
If this entry is a symlink then the inner SymlinkEntry wrapped into
a Some is returned. If this is not a symlink None is returned.