zagens_core/engine/platform_ext.rs
1//! Platform extension port for tui-specific op dispatch (M8).
2
3use async_trait::async_trait;
4
5use crate::engine::op::Op;
6use crate::engine::runtime::Engine;
7
8/// Tui/desktop hooks invoked from the core op loop.
9#[async_trait]
10pub trait EnginePlatformExt<P, R>: Send + Sync {
11 fn as_any(&self) -> &dyn std::any::Any;
12 fn as_any_mut(&mut self) -> &mut dyn std::any::Any;
13
14 /// Dispatch an engine operation that requires platform-specific handling.
15 async fn dispatch_op(&mut self, engine: &mut Engine<P, R>, op: Op);
16
17 /// Shutdown hook after the op receiver closes (e.g. MCP pool teardown).
18 async fn on_shutdown(&mut self);
19}