Setting up for data storage.
This commit is contained in:
30
src/morethantext/cache.rs
Normal file
30
src/morethantext/cache.rs
Normal file
@ -0,0 +1,30 @@
|
||||
use async_std::{channel::Receiver, path::PathBuf};
|
||||
|
||||
pub struct Cache;
|
||||
|
||||
impl Cache {
|
||||
pub async fn new<P>(_dir: P) -> Self
|
||||
where
|
||||
P: Into<PathBuf>,
|
||||
{
|
||||
Self {}
|
||||
}
|
||||
|
||||
pub async fn listen(&self, listener: Receiver<String>) {
|
||||
loop {
|
||||
listener.recv().await.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod engine {
|
||||
use super::*;
|
||||
use tempfile::tempdir;
|
||||
|
||||
#[async_std::test]
|
||||
async fn create() {
|
||||
let dir = tempdir().unwrap();
|
||||
Cache::new(dir.path()).await;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user