Skip to main content

EditorRunner

Trait EditorRunner 

Source
pub trait EditorRunner: Send + Sync {
    // Required methods
    fn detect_editor(&self) -> Option<String>;
    fn run(&self, editor: &str, path: &Path) -> Result<()>;
}
Expand description

Abstraction over editor invocation for testability.

Required Methods§

Source

fn detect_editor(&self) -> Option<String>

Detect the editor to use.

Returns None if no editor is available.

Source

fn run(&self, editor: &str, path: &Path) -> Result<()>

Run the editor on the given file path.

Returns Ok(()) if the editor exited successfully, Err otherwise.

Implementors§