looprs-core 0.5.0

Domain types, ports, and macros for looprs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! PluginExecutor port — abstraction over named CLI tool execution.

use std::ffi::OsString;
use std::process::Output;

/// Port: Execute named CLI tools (plugins).
///
/// Abstracts plugin execution so the domain layer can request tool
/// execution without knowing about subprocess details or PATH resolution.
pub trait PluginExecutor: Send + Sync {
    fn has_tool(&self, tool: &str) -> bool;
    fn execute_tool(&self, tool: &str, args: Vec<OsString>) -> std::io::Result<Output>;
    fn execute_tool_if_available(&self, tool: &str, args: Vec<OsString>) -> Option<Output>;
    fn probe_tool_success(&self, tool: &str, args: Vec<OsString>) -> bool;
}