Entry

Enum 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.

The entry represents a symlink.

Implementations§

Source§

impl<'a, B: Backend> Entry<'a, B>

Source

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.

Source

pub fn name(&self) -> &str

Returns the name of the entry.

Source

pub fn size(&self) -> u64

Returns the size of the entry.

Source

pub fn can_read(&self, group: Group) -> bool

Tests whether a member of the given group has read access.

Source

pub fn can_write(&self, group: Group) -> bool

Tests whether a member of the given group has write access.

Source

pub fn can_execute(&self, group: Group) -> bool

Tests whether a member of the given group has execute access.

Source

pub fn appended(&self) -> &DateTime<Utc>

Returns the time when the entry was appened to the archive.

Source

pub fn created(&self) -> &DateTime<Utc>

Returns the time when the originating filesystem entry was created.

Source

pub fn changed(&self) -> &DateTime<Utc>

Returns the time when the originating filesystem entry was changed the last time.

Source

pub fn modified(&self) -> &DateTime<Utc>

Returns the time when the originating filesystem entry was modified the last time.

Source

pub fn is_file(&self) -> bool

Tests whether this entry represents a file.

Source

pub fn as_file(&self) -> Option<&FileEntry<'a, B>>

Returns a reference to the inner FileEntry instance if this entry represents a file.

If this entry is a file then a reference to the inner FileEntry wrapped into a Some is returned. If this is not a file None is returned.

Source

pub fn as_file_mut(&mut self) -> Option<&mut FileEntry<'a, B>>

Returns a mutable reference to the inner FileEntry instance if this entry represents a file.

If this entry is a file then a reference to the inner FileEntry wrapped into a Some is returned. If this is not a file None is returned.

Source

pub fn into_file(self) -> Option<FileEntry<'a, B>>

Returns the inner FileEntry instance if this entry represents a file.

If this entry is a file then the inner FileEntry wrapped into a Some is returned. If this is not a file None is returned.

Source

pub fn is_directory(&self) -> bool

Tests whether this entry represents a directory.

Source

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.

Source

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.

Tests whether this entry represents a symlink.

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.

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.

Auto Trait Implementations§

§

impl<'a, B> Freeze for Entry<'a, B>

§

impl<'a, B> !RefUnwindSafe for Entry<'a, B>

§

impl<'a, B> !Send for Entry<'a, B>

§

impl<'a, B> !Sync for Entry<'a, B>

§

impl<'a, B> Unpin for Entry<'a, B>

§

impl<'a, B> !UnwindSafe for Entry<'a, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.