Skip to main content

TraceSink

Trait TraceSink 

Source
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§

Source

fn emit(&self, record: RequestTrace)

Provided Methods§

Source

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.

Source

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.

Source

fn enabled(&self) -> bool

When false, transports skip record construction entirely.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§