about summary refs log tree commit diff
path: root/tvix/store/src/tests/utils.rs
blob: 6905fe56b5d7b866afcb9e5bf37cb359ef20eebe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::{
    blobservice::{BlobService, MemoryBlobService},
    directoryservice::{DirectoryService, MemoryDirectoryService},
    pathinfoservice::{MemoryPathInfoService, PathInfoService},
};

pub fn gen_blob_service() -> Box<dyn BlobService> {
    Box::new(MemoryBlobService::default())
}

pub fn gen_directory_service() -> impl DirectoryService + Send + Sync + Clone + 'static {
    MemoryDirectoryService::default()
}

pub fn gen_pathinfo_service<DS: DirectoryService + Clone>(
    blob_service: Box<dyn BlobService>,
    directory_service: DS,
) -> impl PathInfoService {
    MemoryPathInfoService::new(blob_service, directory_service)
}