Trait Runnable

Source
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> { ... }
}
Expand description

Trait, which enables using of user-defined types for creating a custom process.

Required Methods§

Source

fn bootstrap_cmd(&self, process_dir: &Path) -> Result<Cmd, String>

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.

Provided Methods§

Source

fn clean_after_fail(&self, process_dir: &Path) -> Result<(), String>

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.

Implementors§