Struct ArchiveEntry
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§
§impl ArchiveEntry
impl ArchiveEntry
pub fn new(path: impl Into<String>, kind: ArchiveEntryKind) -> ArchiveEntry
pub fn new(path: impl Into<String>, kind: ArchiveEntryKind) -> ArchiveEntry
Creates archive entry metadata from a path and kind.
pub fn file(path: impl Into<String>) -> ArchiveEntry
pub fn file(path: impl Into<String>) -> ArchiveEntry
Creates a regular file entry.
pub fn directory(path: impl Into<String>) -> ArchiveEntry
pub fn directory(path: impl Into<String>) -> ArchiveEntry
Creates a directory entry.
pub fn symlink(path: impl Into<String>) -> ArchiveEntry
pub fn symlink(path: impl Into<String>) -> ArchiveEntry
Creates a symbolic link entry.
pub const fn with_size(self, size: u64) -> ArchiveEntry
pub const fn with_size(self, size: u64) -> ArchiveEntry
Adds known entry size metadata.
pub const fn with_mode(self, mode: u32) -> ArchiveEntry
pub const fn with_mode(self, mode: u32) -> ArchiveEntry
Adds known entry mode metadata.
pub const fn with_modified_unix_seconds(self, seconds: i64) -> ArchiveEntry
pub const fn with_modified_unix_seconds(self, seconds: i64) -> ArchiveEntry
Adds known modified timestamp metadata.
pub const fn kind(&self) -> ArchiveEntryKind
pub const fn kind(&self) -> ArchiveEntryKind
Returns the archive entry kind.
pub const fn modified_unix_seconds(&self) -> Option<i64>
pub const fn modified_unix_seconds(&self) -> Option<i64>
Returns the known modified timestamp.
pub const fn is_directory(&self) -> bool
pub const fn is_directory(&self) -> bool
Returns whether this is a directory entry.
pub const fn is_symlink(&self) -> bool
pub const fn is_symlink(&self) -> bool
Returns whether this is a symbolic link entry.
Trait Implementations§
§impl Clone for ArchiveEntry
impl Clone for ArchiveEntry
§fn clone(&self) -> ArchiveEntry
fn clone(&self) -> ArchiveEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ArchiveEntry
impl Debug for ArchiveEntry
§impl Hash for ArchiveEntry
impl Hash for ArchiveEntry
§impl PartialEq for ArchiveEntry
impl PartialEq for ArchiveEntry
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