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

                   
            
                                                  

                                                                 

  

                                                   

 

                                                             

 
                            

                                                 

                                                               
 
use std::sync::Arc;

use crate::{
    blobservice::{BlobService, MemoryBlobService},
    directoryservice::{DirectoryService, MemoryDirectoryService},
    pathinfoservice::{MemoryPathInfoService, PathInfoService},
};

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

pub fn gen_directory_service() -> Arc<dyn DirectoryService> {
    Arc::new(MemoryDirectoryService::default())
}

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