Skip to main content

hm_plugin_sdk/
hook.rs

1use hm_plugin_protocol::{HookEvent, HookOutcome, PluginError};
2
3/// Implemented by lifecycle-hook plugins.
4pub trait LifecycleHook {
5    /// React to a lifecycle event.
6    ///
7    /// # Errors
8    /// Returns a [`PluginError`] describing the failure. The host
9    /// converts errors into build events; whether the build aborts
10    /// depends on the hook's declared `phase`.
11    fn on_event(&self, event: HookEvent) -> Result<HookOutcome, PluginError>;
12}