hydracache-db 0.19.0

Database-neutral query result cache adapter for HydraCache.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use thiserror::Error;

/// Error type returned by database cache adapter helpers.
#[derive(Debug, Error)]
pub enum DbCacheError {
    /// A cached database operation cannot run without an explicit cache key.
    #[error("database cached operation `{operation}` is missing an explicit cache key")]
    MissingKey { operation: String },

    /// The underlying HydraCache operation failed.
    #[error(transparent)]
    Cache(#[from] hydracache::CacheError),
}

/// Database cache adapter result type.
pub type Result<T> = std::result::Result<T, DbCacheError>;