pub trait EventSink: Send + Sync {
// Required method
fn emit<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 KernelEvent,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
// Provided method
fn emit_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 EventRecord,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
}Available on crate feature
harness-kernel only.Expand description
A destination for kernel events (spec 3.2 §7.6): the SSE stream, a channel notifier, an outbound webhook, the audit log.
§Example
use adk_kernel::{EventSink, KernelEvent};
use async_trait::async_trait;
struct Log;
#[async_trait]
impl EventSink for Log {
async fn emit(&self, event: &KernelEvent) -> adk_kernel::Result<()> {
tracing::info!(event.kind = event.name(), "kernel event");
Ok(())
}
}Required Methods§
Sourcefn emit<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 KernelEvent,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn emit<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 KernelEvent,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Provided Methods§
Sourcefn emit_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 EventRecord,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn emit_record<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 EventRecord,
) -> Pin<Box<dyn Future<Output = Result<(), KernelError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".