Struct DirEntry
struct DirEntry { ... }
A directory entry with a possible error attached.
The error typically refers to a problem parsing ignore files in a particular directory.
Implementations
impl DirEntry
fn path(self: &Self) -> &PathThe full path that this entry represents.
fn into_path(self: Self) -> PathBufThe full path that this entry represents. Analogous to
DirEntry::path, but moves ownership of the path.fn path_is_symlink(self: &Self) -> boolWhether this entry corresponds to a symbolic link or not.
fn is_stdin(self: &Self) -> boolReturns true if and only if this entry corresponds to stdin.
i.e., The entry has depth 0 and its file name is
-.fn metadata(self: &Self) -> Result<Metadata, Error>Return the metadata for the file that this entry points to.
fn file_type(self: &Self) -> Option<FileType>Return the file type for the file that this entry points to.
This entry doesn't have a file type if it corresponds to stdin.
fn file_name(self: &Self) -> &OsStrReturn the file name of this entry.
If this entry has no file name (e.g.,
/), then the full path is returned.fn depth(self: &Self) -> usizeReturns the depth at which this entry was created relative to the root.
fn ino(self: &Self) -> Option<u64>Returns the underlying inode number if one exists.
If this entry doesn't have an inode number, then
Noneis returned.fn error(self: &Self) -> Option<&Error>Returns an error, if one exists, associated with processing this entry.
An example of an error is one that occurred while parsing an ignore file. Errors related to traversing a directory tree itself are reported as part of yielding the directory entry, and not with this method.
impl Clone for DirEntry
fn clone(self: &Self) -> DirEntry
impl Debug for DirEntry
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for DirEntry
impl RefUnwindSafe for DirEntry
impl Send for DirEntry
impl Sync for DirEntry
impl Unpin for DirEntry
impl UnsafeUnpin for DirEntry
impl UnwindSafe for DirEntry
impl<T> Any for DirEntry
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for DirEntry
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for DirEntry
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for DirEntry
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for DirEntry
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Pointable for DirEntry
unsafe fn init(init: <T as Pointable>::Init) -> usizeunsafe fn deref<'a>(ptr: usize) -> &'a Tunsafe fn deref_mut<'a>(ptr: usize) -> &'a mut Tunsafe fn drop(ptr: usize)
impl<T> ToOwned for DirEntry
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for DirEntry
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for DirEntry
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for DirEntry
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>