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 as_file_mut(&mut self) -> Option<&mut FileEntry<'a, B>>
pub fn as_file_mut(&mut self) -> Option<&mut FileEntry<'a, B>>
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.