pub struct DirEntry { /* private fields */ }
Expand description
A directory entry with a possible error attached.
The error typically refers to a problem parsing ignore files in a particular directory.
Implementations
sourceimpl DirEntry
impl DirEntry
sourcepub fn into_path(self) -> PathBuf
pub fn into_path(self) -> PathBuf
The full path that this entry represents.
Analogous to path
, but moves ownership of the path.
sourcepub fn path_is_symlink(&self) -> bool
pub fn path_is_symlink(&self) -> bool
Whether this entry corresponds to a symbolic link or not.
sourcepub fn is_stdin(&self) -> bool
pub fn is_stdin(&self) -> bool
Returns true if and only if this entry corresponds to stdin.
i.e., The entry has depth 0 and its file name is -
.
sourcepub fn metadata(&self) -> Result<Metadata, Error>
pub fn metadata(&self) -> Result<Metadata, Error>
Return the metadata for the file that this entry points to.
sourcepub fn file_type(&self) -> Option<FileType>
pub fn file_type(&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.
sourcepub fn file_name(&self) -> &OsStr
pub fn file_name(&self) -> &OsStr
Return the file name of this entry.
If this entry has no file name (e.g., /
), then the full path is
returned.
sourcepub fn depth(&self) -> usize
pub fn depth(&self) -> usize
Returns the depth at which this entry was created relative to the root.
sourcepub fn ino(&self) -> Option<u64>
pub fn ino(&self) -> Option<u64>
Returns the underlying inode number if one exists.
If this entry doesn’t have an inode number, then None
is returned.
sourcepub fn error(&self) -> Option<&Error>
pub fn error(&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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DirEntry
impl Send for DirEntry
impl Sync for DirEntry
impl Unpin for DirEntry
impl !UnwindSafe for DirEntry
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more