pub enum EntryKind {
Regular {
hash: Hash,
size: u64,
sparse_map: Option<Vec<SparseRegion>>,
},
Symlink {
hash: Hash,
},
Directory {
hash: Hash,
uid: u32,
gid: u32,
mode: u32,
xattrs: Vec<Xattr>,
},
BlockDevice {
major: u32,
minor: u32,
uid: u32,
gid: u32,
mode: u32,
xattrs: Vec<Xattr>,
},
CharDevice {
major: u32,
minor: u32,
uid: u32,
gid: u32,
mode: u32,
xattrs: Vec<Xattr>,
},
Fifo {
uid: u32,
gid: u32,
mode: u32,
xattrs: Vec<Xattr>,
},
Socket {
uid: u32,
gid: u32,
mode: u32,
xattrs: Vec<Xattr>,
},
Hardlink {
target_path: String,
},
}Expand description
kind of tree entry with associated metadata
Variants§
Regular
regular file
Symlink
symbolic link
Directory
directory
BlockDevice
block device
CharDevice
character device
Fifo
named pipe (fifo)
Socket
unix socket
Hardlink
hardlink to another file in the same tree
Implementations§
Source§impl EntryKind
impl EntryKind
Sourcepub fn is_directory(&self) -> bool
pub fn is_directory(&self) -> bool
is this a directory entry
Sourcepub fn is_regular(&self) -> bool
pub fn is_regular(&self) -> bool
is this a regular file entry
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
is this a symlink entry
Sourcepub fn hash(&self) -> Option<&Hash>
pub fn hash(&self) -> Option<&Hash>
get the hash if this entry has one (files, symlinks, directories)
Sourcepub fn sparse(hash: Hash, size: u64, sparse_map: Vec<SparseRegion>) -> Self
pub fn sparse(hash: Hash, size: u64, sparse_map: Vec<SparseRegion>) -> Self
create a sparse regular file entry
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EntryKind
impl<'de> Deserialize<'de> for EntryKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EntryKind
impl StructuralPartialEq for EntryKind
Auto Trait Implementations§
impl Freeze for EntryKind
impl RefUnwindSafe for EntryKind
impl Send for EntryKind
impl Sync for EntryKind
impl Unpin for EntryKind
impl UnsafeUnpin for EntryKind
impl UnwindSafe for EntryKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.