feat(core): Add runtime engine, input parsing, and hook trait.
This commit is contained in:
15
crates/pikl-core/src/runtime/hook.rs
Normal file
15
crates/pikl-core/src/runtime/hook.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
//! Hook trait for lifecycle events. The core library defines
|
||||
//! the interface; concrete implementations (shell hooks, IPC
|
||||
//! hooks, etc.) live in frontend crates.
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::error::PiklError;
|
||||
|
||||
/// A lifecycle hook that fires on menu events. Implementations
|
||||
/// live outside pikl-core (e.g. in the CLI binary) so the core
|
||||
/// library stays free of process/libc deps.
|
||||
#[allow(async_fn_in_trait)]
|
||||
pub trait Hook: Send + Sync {
|
||||
async fn run(&self, value: &Value) -> Result<(), PiklError>;
|
||||
}
|
||||
Reference in New Issue
Block a user