Skip to main content

BaselineStore

Trait BaselineStore 

Source
pub trait BaselineStore: Send + Sync {
Show 13 methods // Required methods fn create<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 BaselineRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, version: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Option<BaselineRecord>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn get_latest<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<BaselineRecord>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn list<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, query: &'life2 ListBaselinesQuery, ) -> Pin<Box<dyn Future<Output = Result<ListBaselinesResponse, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn update<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 BaselineRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, version: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn hard_delete<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, version: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn list_versions<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BaselineVersion>, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<StorageHealth, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn backend_type(&self) -> &'static str; fn create_verdict<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 VerdictRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_verdicts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, query: &'life2 ListVerdictsQuery, ) -> Pin<Box<dyn Future<Output = Result<ListVerdictsResponse, StoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; // Provided method fn pool_metrics(&self) -> Option<PoolMetrics> { ... }
}
Expand description

Trait for baseline storage operations.

This trait abstracts the storage layer, allowing different backends (in-memory, SQLite, PostgreSQL) to be used interchangeably.

Required Methods§

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 BaselineRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stores a new baseline record.

Source

fn get<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, version: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Option<BaselineRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Retrieves a baseline by project, benchmark, and version.

Source

fn get_latest<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<BaselineRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieves the latest baseline for a project and benchmark.

Source

fn list<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, query: &'life2 ListBaselinesQuery, ) -> Pin<Box<dyn Future<Output = Result<ListBaselinesResponse, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Lists baselines with optional filtering.

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 BaselineRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Updates an existing baseline record.

Source

fn delete<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, version: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Deletes a baseline (soft delete).

Source

fn hard_delete<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, version: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Permanently removes a deleted baseline.

Source

fn list_versions<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, benchmark: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BaselineVersion>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Lists all versions for a benchmark.

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<StorageHealth, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks if the storage backend is healthy.

Source

fn backend_type(&self) -> &'static str

Returns the backend type name.

Source

fn create_verdict<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 VerdictRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stores a new verdict record.

Source

fn list_verdicts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, project: &'life1 str, query: &'life2 ListVerdictsQuery, ) -> Pin<Box<dyn Future<Output = Result<ListVerdictsResponse, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Lists verdicts with optional filtering.

Provided Methods§

Source

fn pool_metrics(&self) -> Option<PoolMetrics>

Returns connection pool metrics, if the backend uses a pool.

The default implementation returns None, which is appropriate for backends without a connection pool (e.g., in-memory or SQLite).

Implementors§