pub trait ToolAuditSink:
Send
+ Sync
+ 'static {
// Required method
fn record<'life0, 'async_trait>(
&'life0 self,
record: ToolAuditRecord,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Async sink that receives one ToolAuditRecord per tool-call
lifecycle transition.
Sinks must be cheap: the turn loop awaits record on the hot
path. If the durable backend is slow, the implementation should
buffer and flush asynchronously rather than blocking the sink.
The sink must never panic; persistence failures should be logged
locally and a persistence_failed record fed back through the
normal path.
Required Methods§
Sourcefn record<'life0, 'async_trait>(
&'life0 self,
record: ToolAuditRecord,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn record<'life0, 'async_trait>(
&'life0 self,
record: ToolAuditRecord,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Record a single lifecycle event for a tool call.
Called from the authoritative turn loop at every lifecycle
transition. Implementations should be idempotent keyed on
(record.tool_call_id, record.outcome_kind()) — the same logical
transition may arrive more than once if the loop retries after
a transient failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<S> ToolAuditSink for Arc<S>where
S: ToolAuditSink + ?Sized,
Blanket impl so Arc<S> is itself a sink — lets callers share one
backend across clone boundaries without wrapping.
impl<S> ToolAuditSink for Arc<S>where
S: ToolAuditSink + ?Sized,
Blanket impl so Arc<S> is itself a sink — lets callers share one
backend across clone boundaries without wrapping.