about summary refs log blame commit diff
path: root/tvix/store/src/tests/utils.rs
blob: 285db449d36da598df2e4799851ff1b9854b300a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
            
                                                  

                                                                 

  

                                                   

 

                                                             

 
                            
                                       
                                                 

                                                               
 
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() -> Box<dyn DirectoryService> {
    Box::new(MemoryDirectoryService::default())
}

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