bincache 0.5.1

ZitaneLabs binary cache.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use async_trait::async_trait;

use super::{CacheKey, CacheStrategy};
use crate::Result;

/// A cache strategy that can flush its data to a non-volatile storage.
#[async_trait]
pub trait FlushableStrategy: CacheStrategy {
    async fn flush<K>(
        &mut self,
        key: &K,
        entry: &Self::CacheEntry,
    ) -> Result<Option<Self::CacheEntry>>
    where
        K: CacheKey + Sync + Send;
}