31 lines
532 B
Rust
31 lines
532 B
Rust
|
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;
|
||
|
}
|
||
|
}
|