2023-02-27 08:59:45 +01:00
|
|
|
use crate::{
|
2023-03-03 22:38:40 +01:00
|
|
|
blobservice::{BlobService, MemoryBlobService},
|
|
|
|
directoryservice::{DirectoryService, MemoryDirectoryService},
|
|
|
|
pathinfoservice::{MemoryPathInfoService, PathInfoService},
|
2023-02-27 08:59:45 +01:00
|
|
|
};
|
|
|
|
|
2023-05-25 16:52:08 +02:00
|
|
|
pub fn gen_blob_service() -> Box<dyn BlobService> {
|
|
|
|
Box::new(MemoryBlobService::default())
|
2023-02-27 08:59:45 +01:00
|
|
|
}
|
|
|
|
|
2023-03-01 18:55:51 +01:00
|
|
|
pub fn gen_directory_service() -> impl DirectoryService + Send + Sync + Clone + 'static {
|
2023-03-10 12:20:26 +01:00
|
|
|
MemoryDirectoryService::default()
|
2023-02-27 08:59:45 +01:00
|
|
|
}
|
|
|
|
|
2023-06-09 09:28:02 +02:00
|
|
|
pub fn gen_pathinfo_service<DS: DirectoryService + Clone>(
|
|
|
|
blob_service: Box<dyn BlobService>,
|
|
|
|
directory_service: DS,
|
|
|
|
) -> impl PathInfoService {
|
|
|
|
MemoryPathInfoService::new(blob_service, directory_service)
|
2023-02-27 08:59:45 +01:00
|
|
|
}
|