Skip to main content

senax_common/cache/
storage_cache_dummy.rs

1#![allow(unused_variables)]
2use anyhow::Result;
3use std::path::PathBuf;
4
5use super::msec::MSec;
6
7pub struct StorageCache;
8impl StorageCache {
9    pub fn start(
10        path: PathBuf,
11        index_size: u64,
12        file_num: usize,
13        file_size: u64,
14        ttl: u64,
15    ) -> Result<StorageCache, anyhow::Error> {
16        Ok(StorageCache)
17    }
18
19    pub fn stop(&self) {}
20
21    pub fn write(&self, hash: u128, type_id: u64, data: &[u8], time: MSec) {}
22
23    pub async fn read(&self, hash: u128, type_id: u64, estimate: usize) -> Option<Vec<u8>> {
24        None
25    }
26
27    pub fn invalidate_all_of(&self, type_id: u64) {}
28
29    pub fn invalidate_all(&self) {}
30}