use super::{Cache, CacheRecord, IntoCache};
#[derive(Debug, thiserror::Error)]
pub enum CacheRepoError {
#[error("Unable to set cache record")]
SetFailed,
}
#[async_trait::async_trait]
pub trait CacheRepo {
async fn get_memo(
&self,
uri: impl AsRef<str> + Send,
) -> Result<Cache<CacheRecord>, CacheRepoError>;
async fn set_memo<CacheCandidate>(
&self,
record: CacheCandidate,
) -> Result<CacheRecord, CacheRepoError>
where
CacheCandidate: IntoCache + Send;
}