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.
Provided Methods§
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.