Trait genfs::DirEntry
[−]
[src]
pub trait DirEntry { type Path: ?Sized; type PathOwned; type Metadata; type FileType; type Error; fn path(&self) -> Self::PathOwned; fn metadata(&self) -> Result<Self::Metadata, Self::Error>; fn file_type(&self) -> Result<Self::FileType, Self::Error>; fn file_name(&self) -> &Self::Path; }
Entries returned by the Dir
iterator.
An instance of DirEntry
represents an entry inside of a directory on the
filesystem. Each entry can be inspected via methods to learn about the full
path or possibly other metadata through per-platform extension traits.
Associated Types
type Path: ?Sized
The borrowed path slice that represents a relative or absolute path on the filesystem.
type PathOwned
The owned path that represents a relative or absolute path on the filesystem.
type Metadata
The type that represents a files metadata on the filesystem.
type FileType
The type that represents the union of all possible filetypes.
type Error
The type that represents the set of all errors that can occur during reading or writing.
Required Methods
fn path(&self) -> Self::PathOwned
Returns the full path to the file that this entry represents.
The full path is created by joining the original path to read_dir
with the filename of this entry.
fn metadata(&self) -> Result<Self::Metadata, Self::Error>
Return the metadata for the file that this entry points at.
This function will not traverse symlinks if this entry points at a symlink.
fn file_type(&self) -> Result<Self::FileType, Self::Error>
Return the file type for the file that this entry points at.
This function will not traverse symlinks if this entry points at a symlink.
fn file_name(&self) -> &Self::Path
Returns the bare file name of this directory entry without any other leading path component.