Trait emu_runner::EmulatorContext
source · pub trait EmulatorContext: Sized {
// Required methods
fn cmd_name(&self) -> String;
fn args(&self) -> Vec<String>;
fn env(&self) -> Vec<(String, String)>;
fn working_dir(&self) -> Utf8PathBuf;
fn prepare(&mut self) -> Result<(), Error>;
// Provided method
fn run(self) -> Result<Output, Error> { ... }
}Expand description
Behavior used to run an emulator.
Required Methods§
sourcefn cmd_name(&self) -> String
fn cmd_name(&self) -> String
Returns the name of the base command to be executed.
Typically this is the executable file of the emulator (e.g. BizHawk.exe or fceux.exe).
If the executable is a linux binary in the working-directory, be sure to use ./cmd_name rather than just cmd_name.
sourcefn args(&self) -> Vec<String>
fn args(&self) -> Vec<String>
Returns a list of arguments to be passed to Command::args.
sourcefn env(&self) -> Vec<(String, String)>
fn env(&self) -> Vec<(String, String)>
Returns a list of environment variables to be passed to Command::envs.
sourcefn working_dir(&self) -> Utf8PathBuf
fn working_dir(&self) -> Utf8PathBuf
Returns the path to the working directory intended for the command’s child process.
Refer to Command::current_dir for more details.