pub trait Runnable: Debug + Send + 'static { // Required method fn bootstrap_cmd(&self, process_dir: &Path) -> Result<Cmd, String>; // Provided method fn clean_after_fail(&self, process_dir: &Path) -> Result<(), String> { ... } }
Trait, which enables using of user-defined types for creating a custom process.
This method should prepare process to run and return Cmd used to spawn a custom process. If you need to create some files for properly spawning a process, do it inside provided process_dir directory.
Cmd
process_dir
This method is called when process spawning fails. Notice that process_dir will be deleted automatically, so there is no need to delete it here.