pub trait System {
Show 13 methods
// Required methods
fn read(&self, path: &Path) -> Option<String>;
fn exists(&self, path: &Path) -> bool;
fn list(&self, path: &Path) -> Vec<String>;
fn link(&self, path: &Path) -> Option<PathBuf>;
fn run(&self, command: &[&str]) -> Option<(bool, String)>;
fn resolve(&self, host: &str) -> Result<Vec<String>, String>;
fn space(&self, path: &Path) -> Option<(u64, u64)>;
fn owner(&self, path: &Path) -> Option<u32>;
fn is_link(&self, path: &Path) -> bool;
fn canonical(&self, path: &Path) -> Option<PathBuf>;
fn user(&self) -> (u32, u32, PathBuf);
fn on_path(&self, tool: &str) -> bool;
fn processes(&self) -> Vec<String>;
}Expand description
What the checks read from the machine; tests give a made-up one.
Required Methods§
fn read(&self, path: &Path) -> Option<String>
fn exists(&self, path: &Path) -> bool
fn list(&self, path: &Path) -> Vec<String>
fn link(&self, path: &Path) -> Option<PathBuf>
Sourcefn run(&self, command: &[&str]) -> Option<(bool, String)>
fn run(&self, command: &[&str]) -> Option<(bool, String)>
A command’s success and standard output; None when it cannot run.
Sourcefn resolve(&self, host: &str) -> Result<Vec<String>, String>
fn resolve(&self, host: &str) -> Result<Vec<String>, String>
The addresses a host name resolves to, within a few seconds.
Sourcefn space(&self, path: &Path) -> Option<(u64, u64)>
fn space(&self, path: &Path) -> Option<(u64, u64)>
Free and total bytes of the file system holding a path.
fn user(&self) -> (u32, u32, PathBuf)
fn on_path(&self, tool: &str) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".