Trait Runtime

Source
pub trait Runtime
where Self: Copy + Clone,
{ const INTERNAL_SYMBOL: &'static str = "___internal___";
Show 21 methods // Required methods fn os(&self) -> String; fn shell_path(&self) -> Result<String>; fn bash_path(&self) -> Option<String>; fn exec_bash_functions( &self, script_file: &str, functions: &[&str], args: &[String], envs: HashMap<String, String>, ) -> Option<Vec<String>>; fn current_exe(&self) -> Option<String>; fn current_dir(&self) -> Option<String>; fn env_vars(&self) -> HashMap<String, String>; fn env_var(&self, name: &str) -> Option<String>; fn which(&self, name: &str) -> Option<String>; fn exist_path(&self, path: &str) -> bool; fn parent_path(&self, path: &str) -> Option<String>; fn join_path(&self, path: &str, parts: &[&str]) -> String; fn chdir(&self, cwd: &str, cd: &str) -> Option<String>; fn metadata(&self, path: &str) -> Option<(bool, bool, bool)>; fn read_dir(&self, path: &str) -> Option<Vec<String>>; fn read_to_string(&self, path: &str) -> Option<String>; // Provided methods fn is_windows(&self) -> bool { ... } fn shell_args(&self, shell_path: &str) -> Vec<String> { ... } fn basename(&self, path: &str) -> Option<String> { ... } fn load_dotenv(&self, path: &str) -> Option<HashMap<String, String>> { ... } fn path_env_with_current_exe(&self) -> String { ... }
}

Provided Associated Constants§

Source

const INTERNAL_SYMBOL: &'static str = "___internal___"

Required Methods§

Source

fn os(&self) -> String

Source

fn shell_path(&self) -> Result<String>

Source

fn bash_path(&self) -> Option<String>

Source

fn exec_bash_functions( &self, script_file: &str, functions: &[&str], args: &[String], envs: HashMap<String, String>, ) -> Option<Vec<String>>

Source

fn current_exe(&self) -> Option<String>

Source

fn current_dir(&self) -> Option<String>

Source

fn env_vars(&self) -> HashMap<String, String>

Source

fn env_var(&self, name: &str) -> Option<String>

Source

fn which(&self, name: &str) -> Option<String>

Source

fn exist_path(&self, path: &str) -> bool

Source

fn parent_path(&self, path: &str) -> Option<String>

Source

fn join_path(&self, path: &str, parts: &[&str]) -> String

Source

fn chdir(&self, cwd: &str, cd: &str) -> Option<String>

Source

fn metadata(&self, path: &str) -> Option<(bool, bool, bool)>

Source

fn read_dir(&self, path: &str) -> Option<Vec<String>>

Source

fn read_to_string(&self, path: &str) -> Option<String>

Provided Methods§

Source

fn is_windows(&self) -> bool

Source

fn shell_args(&self, shell_path: &str) -> Vec<String>

Source

fn basename(&self, path: &str) -> Option<String>

Source

fn load_dotenv(&self, path: &str) -> Option<HashMap<String, String>>

Source

fn path_env_with_current_exe(&self) -> String

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§