Skip to main content

RunTraceStore

Trait RunTraceStore 

Source
pub trait RunTraceStore: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn append<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: &'life1 RunId,
        draft: TraceEventDraft,
    ) -> Pin<Box<dyn Future<Output = Result<TraceEvent, TraceStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: &'life1 RunId,
        query: &'life2 TraceQuery,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TraceEvent>, TraceStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        run_id: &'life1 RunId,
    ) -> Pin<Box<dyn Future<Output = Result<u64, TraceStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persistence interface for the per-Run trace stream.

Required Methods§

Source

fn name(&self) -> &str

Backend name — for diagnostics/logging.

Source

fn append<'life0, 'life1, 'async_trait>( &'life0 self, run_id: &'life1 RunId, draft: TraceEventDraft, ) -> Pin<Box<dyn Future<Output = Result<TraceEvent, TraceStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Append one event to run_id’s stream, assigning the next seq and stamping ts_ms. The store caps draft.payload via cap_payload and prunes the oldest rows beyond the per-Run retention ceiling. Appending to an unknown run_id is legal — the trace rail has no foreign-key coupling to RunStore (a trace writer must never fail because Run-row creation raced it).

Source

fn list<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: &'life1 RunId, query: &'life2 TraceQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<TraceEvent>, TraceStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

List run_id’s events matching query, ascending by seq.

Source

fn delete_run<'life0, 'life1, 'async_trait>( &'life0 self, run_id: &'life1 RunId, ) -> Pin<Box<dyn Future<Output = Result<u64, TraceStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete every event belonging to run_id, returning the number of deleted events. Deleting an unknown/empty Run is Ok(0).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§