pub trait Sys {
// Required methods
fn write(&self, stream: Stream, s: &str) -> Result<()>;
fn real_path(&self, path: &Path) -> Option<PathBuf>;
fn read_source(&self, path: &Path) -> Option<String>;
fn var(&self, name: &str) -> Option<String>;
fn vars(&self) -> Vec<(String, String)>;
fn exit(&self, code: i32) -> !;
}Expand description
The system surface a host offers Elly: output, module sources, the
environment and the way out. The resolver and IO reach the outside world
only through this.
Required Methods§
Sourcefn real_path(&self, path: &Path) -> Option<PathBuf>
fn real_path(&self, path: &Path) -> Option<PathBuf>
The canonical form of path, with symlinks resolved, or None if there
is nothing there. A resolved module’s canonical name is its real path.
Sourcefn read_source(&self, path: &Path) -> Option<String>
fn read_source(&self, path: &Path) -> Option<String>
The text of the file at path, or None if it is not a readable UTF-8
file.
Sourcefn var(&self, name: &str) -> Option<String>
fn var(&self, name: &str) -> Option<String>
The environment variable name, if it is set and UTF-8.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".