about summary refs log tree commit diff
path: root/tvix/store/src/tests/utils.rs
blob: 4ddd4102fb9781057b1f2a0e3372624e2167fd46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::path::Path;

use crate::{
    blobservice::{BlobService, SledBlobService},
    chunkservice::{ChunkService, SledChunkService},
    directoryservice::{DirectoryService, SledDirectoryService},
    pathinfoservice::{PathInfoService, SledPathInfoService},
};

pub fn gen_blob_service(p: &Path) -> impl BlobService + Send + Sync + Clone + 'static {
    SledBlobService::new(p.join("blobs")).unwrap()
}

pub fn gen_chunk_service(p: &Path) -> impl ChunkService + Clone {
    SledChunkService::new(p.join("chunks")).unwrap()
}

pub fn gen_directory_service(p: &Path) -> impl DirectoryService + Send + Sync + Clone + 'static {
    SledDirectoryService::new(p.join("directories")).unwrap()
}

pub fn gen_pathinfo_service(p: &Path) -> impl PathInfoService {
    SledPathInfoService::new(p.join("pathinfo")).unwrap()
}