pub trait DirReader {
// Required methods
fn read_dir(&self, path: &Path) -> Result<Vec<DirEntry>>;
fn read_file(&self, path: &Path) -> Result<Vec<u8>>;
fn is_executable(&self, path: &Path) -> Result<bool>;
fn is_ignored(&self, path: &Path, is_dir: bool) -> bool;
fn mtime_ms(&self, path: &Path) -> Result<Option<u64>>;
}Expand description
Filesystem abstraction so substrate can drive traversal without doing I/O itself.
Required Methods§
Sourcefn read_dir(&self, path: &Path) -> Result<Vec<DirEntry>>
fn read_dir(&self, path: &Path) -> Result<Vec<DirEntry>>
List immediate children of a directory.
Sourcefn is_executable(&self, path: &Path) -> Result<bool>
fn is_executable(&self, path: &Path) -> Result<bool>
Check whether a file has the executable bit set.
Sourcefn is_ignored(&self, path: &Path, is_dir: bool) -> bool
fn is_ignored(&self, path: &Path, is_dir: bool) -> bool
Check whether a path is ignored by follow_rules (gitignore-style).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".