Skip to main content

System

Trait System 

Source
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§

Source

fn read(&self, path: &Path) -> Option<String>

Source

fn exists(&self, path: &Path) -> bool

Source

fn list(&self, path: &Path) -> Vec<String>

Source

fn run(&self, command: &[&str]) -> Option<(bool, String)>

A command’s success and standard output; None when it cannot run.

Source

fn resolve(&self, host: &str) -> Result<Vec<String>, String>

The addresses a host name resolves to, within a few seconds.

Source

fn space(&self, path: &Path) -> Option<(u64, u64)>

Free and total bytes of the file system holding a path.

Source

fn owner(&self, path: &Path) -> Option<u32>

The owner’s user id.

Whether the path itself is a symbolic link.

Source

fn canonical(&self, path: &Path) -> Option<PathBuf>

The path with every link resolved.

Source

fn user(&self) -> (u32, u32, PathBuf)

Source

fn on_path(&self, tool: &str) -> bool

Source

fn processes(&self) -> Vec<String>

Names of running processes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§