1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use thiserror::Error; /// Cache result type. pub type CacheResult<T> = Result<T, CacheError>; /// Errors returned by cache backends. #[derive(Debug, Error)] pub enum CacheError { /// Serialization failed. #[error("cache serialization error: {0}")] Serde(#[from] serde_json::Error), /// Backend operation failed. #[error("cache backend error: {0}")] Backend(String), }