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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§