pub struct ArchiveEntry {
pub path: String,
pub kind: ArchiveEntryKind,
pub size: Option<u64>,
pub mode: Option<u32>,
pub modified_unix_seconds: Option<i64>,
}Expand description
Generic archive entry metadata.
Fields§
§path: StringArchive-internal path.
kind: ArchiveEntryKindArchive entry kind.
size: Option<u64>Entry payload size in bytes, when known.
mode: Option<u32>Entry mode or permission bits, when known.
modified_unix_seconds: Option<i64>Unix timestamp seconds for the modified time, when known.
Implementations§
Source§impl ArchiveEntry
impl ArchiveEntry
Sourcepub fn new(path: impl Into<String>, kind: ArchiveEntryKind) -> Self
pub fn new(path: impl Into<String>, kind: ArchiveEntryKind) -> Self
Creates archive entry metadata from a path and kind.
Sourcepub const fn with_modified_unix_seconds(self, seconds: i64) -> Self
pub const fn with_modified_unix_seconds(self, seconds: i64) -> Self
Adds known modified timestamp metadata.
Sourcepub const fn kind(&self) -> ArchiveEntryKind
pub const fn kind(&self) -> ArchiveEntryKind
Returns the archive entry kind.
Sourcepub const fn modified_unix_seconds(&self) -> Option<i64>
pub const fn modified_unix_seconds(&self) -> Option<i64>
Returns the known modified timestamp.
Sourcepub const fn is_directory(&self) -> bool
pub const fn is_directory(&self) -> bool
Returns whether this is a directory entry.
Sourcepub const fn is_symlink(&self) -> bool
pub const fn is_symlink(&self) -> bool
Returns whether this is a symbolic link entry.
Trait Implementations§
Source§impl Clone for ArchiveEntry
impl Clone for ArchiveEntry
Source§fn clone(&self) -> ArchiveEntry
fn clone(&self) -> ArchiveEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArchiveEntry
impl Debug for ArchiveEntry
Source§impl Hash for ArchiveEntry
impl Hash for ArchiveEntry
Source§impl PartialEq for ArchiveEntry
impl PartialEq for ArchiveEntry
Source§fn eq(&self, other: &ArchiveEntry) -> bool
fn eq(&self, other: &ArchiveEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ArchiveEntry
impl StructuralPartialEq for ArchiveEntry
Auto Trait Implementations§
impl Freeze for ArchiveEntry
impl RefUnwindSafe for ArchiveEntry
impl Send for ArchiveEntry
impl Sync for ArchiveEntry
impl Unpin for ArchiveEntry
impl UnsafeUnpin for ArchiveEntry
impl UnwindSafe for ArchiveEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more