pub trait AppEventEmitter: Send + Sync {
// Required method
fn emit(&self, event: AppEvent);
}Expand description
Trait for emitting application events.
This abstraction keeps event plumbing consistent across domains and prevents channel types from becoming part of the public API surface.
§Implementations
NoopEmitter- For tests and CLI contexts that don’t need events- Adapter-specific implementations (Tauri, Axum SSE, etc.)
§Example
ⓘ
// In a service
fn start_server(&self, emitter: Arc<dyn AppEventEmitter>) {
// ... start server logic ...
emitter.emit(AppEvent::server_started(model_id, model_name, port));
}