pub struct FallbackClient { /* private fields */ }Expand description
Client with fallback storage support.
This client wraps the main BaselineClient and provides automatic
fallback to local storage when the server is unavailable.
Implementations§
Source§impl FallbackClient
impl FallbackClient
Sourcepub fn new(client: BaselineClient, fallback: Option<FallbackStorage>) -> Self
pub fn new(client: BaselineClient, fallback: Option<FallbackStorage>) -> Self
Creates a new fallback client.
Sourcepub fn inner(&self) -> &BaselineClient
pub fn inner(&self) -> &BaselineClient
Gets the underlying client.
Sourcepub async fn get_latest_baseline(
&self,
project: &str,
benchmark: &str,
) -> Result<BaselineRecord, ClientError>
pub async fn get_latest_baseline( &self, project: &str, benchmark: &str, ) -> Result<BaselineRecord, ClientError>
Gets the latest baseline with fallback support.
First tries the server, then falls back to local storage if available.
Sourcepub async fn get_baseline_version(
&self,
project: &str,
benchmark: &str,
version: &str,
) -> Result<BaselineRecord, ClientError>
pub async fn get_baseline_version( &self, project: &str, benchmark: &str, version: &str, ) -> Result<BaselineRecord, ClientError>
Gets a specific baseline version with fallback support.
Sourcepub async fn upload_baseline(
&self,
project: &str,
request: &UploadBaselineRequest,
) -> Result<UploadBaselineResponse, ClientError>
pub async fn upload_baseline( &self, project: &str, request: &UploadBaselineRequest, ) -> Result<UploadBaselineResponse, ClientError>
Uploads a baseline with fallback support.
If the server is unavailable and fallback is configured, saves to local storage.
Sourcepub async fn list_baselines(
&self,
project: &str,
query: &ListBaselinesQuery,
) -> Result<ListBaselinesResponse, ClientError>
pub async fn list_baselines( &self, project: &str, query: &ListBaselinesQuery, ) -> Result<ListBaselinesResponse, ClientError>
Lists baselines (server only, no fallback).
Sourcepub async fn delete_baseline(
&self,
project: &str,
benchmark: &str,
version: &str,
) -> Result<(), ClientError>
pub async fn delete_baseline( &self, project: &str, benchmark: &str, version: &str, ) -> Result<(), ClientError>
Deletes a baseline (server only, no fallback).
Sourcepub async fn promote_baseline(
&self,
project: &str,
benchmark: &str,
request: &PromoteBaselineRequest,
) -> Result<PromoteBaselineResponse, ClientError>
pub async fn promote_baseline( &self, project: &str, benchmark: &str, request: &PromoteBaselineRequest, ) -> Result<PromoteBaselineResponse, ClientError>
Promotes a baseline (server only, no fallback).
Sourcepub async fn submit_verdict(
&self,
project: &str,
request: &SubmitVerdictRequest,
) -> Result<VerdictRecord, ClientError>
pub async fn submit_verdict( &self, project: &str, request: &SubmitVerdictRequest, ) -> Result<VerdictRecord, ClientError>
Submits a benchmark verdict (server only, no fallback).
Sourcepub async fn list_verdicts(
&self,
project: &str,
query: &ListVerdictsQuery,
) -> Result<ListVerdictsResponse, ClientError>
pub async fn list_verdicts( &self, project: &str, query: &ListVerdictsQuery, ) -> Result<ListVerdictsResponse, ClientError>
Lists verdicts (server only, no fallback).
Sourcepub async fn health_check(&self) -> Result<HealthResponse, ClientError>
pub async fn health_check(&self) -> Result<HealthResponse, ClientError>
Checks server health.
Sourcepub async fn is_healthy(&self) -> bool
pub async fn is_healthy(&self) -> bool
Returns true if the server is healthy.
Sourcepub fn has_fallback(&self) -> bool
pub fn has_fallback(&self) -> bool
Checks if fallback storage is available.