pub trait TraceSink:
Send
+ Sync
+ Debug {
// Required method
fn emit(&self, record: RequestTrace);
// Provided methods
fn enrich_execution_events(
&self,
_request_id: &TraceId,
_events: Vec<ToolExecutionEvent>,
) { ... }
fn snapshot_for_request(
&self,
_request_id: &TraceId,
) -> Option<RequestTrace> { ... }
fn enabled(&self) -> bool { ... }
}Expand description
Receives finished trace records. Implementations must be cheap and non-blocking: they run inline on the request path.
Required Methods§
fn emit(&self, record: RequestTrace)
Provided Methods§
Sourcefn enrich_execution_events(
&self,
_request_id: &TraceId,
_events: Vec<ToolExecutionEvent>,
)
fn enrich_execution_events( &self, _request_id: &TraceId, _events: Vec<ToolExecutionEvent>, )
Update a previously emitted request record with execution metadata. Default sinks cannot mutate and therefore ignore enrichment; collecting and writer sinks replace in place so one logical transport attempt remains exactly one trace record.
Sourcefn snapshot_for_request(&self, _request_id: &TraceId) -> Option<RequestTrace>
fn snapshot_for_request(&self, _request_id: &TraceId) -> Option<RequestTrace>
Optional latest record snapshot used to append execution-enriched copies after the provider request has completed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".