pub struct DirEntry { /* private fields */ }Expand description
The returned type for each entry found by read_dir.
Each entry represents a single entry inside the directory. Platforms that provide rich metadata may in future expose this through methods or extension traits on DirEntry.
For now however, only the [name()] is exposed. This does not imply any
additional IO for most workloads: metadata returned from a directory listing
is inherently racy: presuming that what was a dir, or symlink etc when the
directory was listed, will still be the same when opened is fallible.
Instead, use open_at to open the contents, and then process based on the
type of content found.