pub enum EntryKind {
File,
Dir,
Symlink,
Special,
}Expand description
Classification of a filesystem entry by type.
Special covers sockets, FIFOs, block/character devices — anything that
isn’t a regular file, directory, or symlink. When a caller has only a best
effort Option<FileType> (e.g. entry.file_type().await.ok()), an unknown
type is treated as File to match historical behavior.
Variants§
Implementations§
Source§impl EntryKind
impl EntryKind
Sourcepub fn from_metadata(metadata: &Metadata) -> Self
pub fn from_metadata(metadata: &Metadata) -> Self
Classify from a Metadata (root-level entries, where we always have full metadata).
Sourcepub fn from_file_type(file_type: Option<&FileType>) -> Self
pub fn from_file_type(file_type: Option<&FileType>) -> Self
Classify from an Option<FileType>. Unknown types (None) are treated
as File to match historical behavior across copy/link/rm: when
entry.file_type() fails, callers proceed as if the entry were a
regular file.
Sourcepub fn label(self) -> &'static str
pub fn label(self) -> &'static str
Short dry-run label used during directory iteration ("dir", "symlink", "file").
Special maps to "file" to match historical behavior — the old bool-triplet
dispatch in copy/link/rm fell through is_dir/is_symlink to “file” for any
other type. The explicit --skip-specials path uses its own literal “special”
string and does not call this helper.
Sourcepub fn label_long(self) -> &'static str
pub fn label_long(self) -> &'static str
Long dry-run label used at the root level ("directory" instead of "dir").
Special maps to "file" for the same reason as Self::label.
Sourcepub fn inc_skipped(self, prog: &Progress)
pub fn inc_skipped(self, prog: &Progress)
Increment the skipped counter that matches this entry kind. Special
files count as files_skipped — specials_skipped is reserved for
the explicit --skip-specials path, not filter skips.
Trait Implementations§
impl Copy for EntryKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request