hm_plugin_sdk/executor.rs
1use hm_plugin_protocol::{ExecutorInput, PluginError, StepResult};
2
3/// Implemented by step-executor plugins. The host calls
4/// [`StepExecutor::run`] exactly once per step; the plugin returns a
5/// [`StepResult`] or a [`PluginError`].
6///
7/// During the call the plugin may stream logs via
8/// [`crate::host::emit_step_log`] and check cancellation via
9/// [`crate::host::should_cancel`].
10pub trait StepExecutor {
11 /// Execute a single step.
12 ///
13 /// # Errors
14 /// Returns a [`PluginError`] describing the failure. The host
15 /// converts errors into build events and a non-zero step exit.
16 fn run(&self, input: ExecutorInput) -> Result<StepResult, PluginError>;
17}