Skip to main content

ShellEnvironment

Trait ShellEnvironment 

Source
pub trait ShellEnvironment {
    // Required methods
    fn get_var(&self, name: &str) -> Option<&str>;
    fn set_var(&mut self, name: &str, value: &str);
    fn export_var(&mut self, name: &str);
    fn unset_var(&mut self, name: &str);
    fn exit_status(&self) -> i32;
    fn set_exit_status(&mut self, status: i32);
    fn chdir(&mut self, path: &str) -> Result<(), String>;
    fn home_dir(&self) -> Option<&str>;
}
Expand description

Trait that builtins use to interact with the shell environment.

Defined here (rather than in frost-exec) so builtins have no dependency on the execution engine.

Required Methods§

Source

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

Source

fn set_var(&mut self, name: &str, value: &str)

Source

fn export_var(&mut self, name: &str)

Source

fn unset_var(&mut self, name: &str)

Source

fn exit_status(&self) -> i32

Source

fn set_exit_status(&mut self, status: i32)

Source

fn chdir(&mut self, path: &str) -> Result<(), String>

Source

fn home_dir(&self) -> Option<&str>

Implementors§