pub trait SourceTree {
// Required methods
fn is_directory(&self, path: &Path) -> bool;
fn entries(&self, path: &Path) -> Result<Vec<PathBuf>, String>;
fn read_text(&self, path: &Path) -> Result<String, String>;
}Expand description
The filesystem facts a recursive source walk needs. 递归源码遍历所需的文件系统事实。
The kernel owns the algorithm and never touches the filesystem; an execution surface supplies these three operations. 内核拥有算法且从不接触文件系统;三项操作由执行面提供。
Required Methods§
Sourcefn is_directory(&self, path: &Path) -> bool
fn is_directory(&self, path: &Path) -> bool
Whether path names a directory; the walk recurses only when this is true.
path 是否为目录;仅当为真时遍历才递归进入。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".