pub enum CacheBackendKind {
Sqlite(SqliteCacheBackend),
Postgres(PostgresCacheBackend),
}Expand description
Enum dispatch for cache backends - zero-cost abstraction over SQLite/Postgres
Variants§
Sqlite(SqliteCacheBackend)
Postgres(PostgresCacheBackend)
Implementations§
Source§impl CacheBackendKind
impl CacheBackendKind
pub async fn get(&self, key: &AssetKey<'_>) -> Result<Option<CachedAsset>>
pub async fn insert_or_replace( &self, key: &AssetKey<'_>, path: &str, sha256: &str, size_bytes: u64, ) -> Result<()>
pub async fn get_all_gems(&self) -> Result<Vec<(String, String)>>
pub async fn stats(&self) -> Result<IndexStats>
pub async fn catalog_upsert_names(&self, names: &[String]) -> Result<()>
pub async fn catalog_total(&self) -> Result<u64>
pub async fn catalog_page(&self, offset: i64, limit: i64) -> Result<Vec<String>>
pub async fn catalog_meta_get(&self, key: &str) -> Result<Option<String>>
pub async fn catalog_meta_set(&self, key: &str, value: &str) -> Result<()>
pub async fn upsert_metadata(&self, metadata: &GemMetadata) -> Result<()>
pub async fn gem_metadata( &self, name: &str, version: &str, platform: Option<&str>, ) -> Result<Option<GemMetadata>>
pub async fn sbom_coverage(&self) -> Result<SbomCoverage>
pub async fn catalog_languages(&self) -> Result<Vec<String>>
pub async fn catalog_page_by_language( &self, language: &str, offset: i64, limit: i64, ) -> Result<Vec<String>>
pub async fn catalog_total_by_language(&self, language: &str) -> Result<u64>
pub async fn get_gem_version( &self, name: &str, version: &str, platform: Option<&str>, ) -> Result<Option<GemVersion>>
pub async fn upsert_gem_version(&self, gem_version: &GemVersion) -> Result<()>
pub async fn get_latest_available_version( &self, name: &str, platform: Option<&str>, now: DateTime<Utc>, ) -> Result<Option<GemVersion>>
pub async fn get_quarantined_versions( &self, name: &str, now: DateTime<Utc>, ) -> Result<Vec<GemVersion>>
pub async fn update_version_status( &self, name: &str, version: &str, platform: Option<&str>, status: VersionStatus, reason: Option<String>, ) -> Result<()>
pub async fn promote_expired_quarantines( &self, now: DateTime<Utc>, ) -> Result<u64>
pub async fn mark_yanked(&self, name: &str, version: &str) -> Result<()>
pub async fn get_all_quarantined( &self, limit: u32, offset: u32, ) -> Result<Vec<GemVersion>>
pub async fn quarantine_stats(&self) -> Result<QuarantineStats>
pub async fn get_gem_versions_for_index( &self, name: &str, ) -> Result<Vec<GemVersion>>
pub async fn quarantine_table_exists(&self) -> Result<bool>
pub async fn run_quarantine_migrations(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for CacheBackendKind
impl Clone for CacheBackendKind
Source§fn clone(&self) -> CacheBackendKind
fn clone(&self) -> CacheBackendKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheBackendKind
impl Debug for CacheBackendKind
Source§impl From<PostgresCacheBackend> for CacheBackendKind
Available on crate feature postgres only.
impl From<PostgresCacheBackend> for CacheBackendKind
Available on crate feature
postgres only.Source§fn from(backend: PostgresCacheBackend) -> Self
fn from(backend: PostgresCacheBackend) -> Self
Converts to this type from the input type.
Source§impl From<SqliteCacheBackend> for CacheBackendKind
impl From<SqliteCacheBackend> for CacheBackendKind
Source§fn from(backend: SqliteCacheBackend) -> Self
fn from(backend: SqliteCacheBackend) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CacheBackendKind
impl !RefUnwindSafe for CacheBackendKind
impl Send for CacheBackendKind
impl Sync for CacheBackendKind
impl Unpin for CacheBackendKind
impl !UnwindSafe for CacheBackendKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more