refactor(tvix/store/pathinfoservice): make more generic

We don't need Arcs in most of the cases, we're fine with some container.

Change-Id: Ic4f8acb5b9d93e2b0923bb607463fb91e9d0e4fe
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10606
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
Florian Klink 2024-01-12 12:18:43 +02:00 committed by clbot
parent 7d51193f7d
commit b59df53774
6 changed files with 51 additions and 54 deletions

View file

@ -4,9 +4,13 @@ use tvix_castore::{blobservice::BlobService, directoryservice::DirectoryService}
pub use tvix_castore::utils::*;
pub fn gen_pathinfo_service(
blob_service: Arc<dyn BlobService>,
directory_service: Arc<dyn DirectoryService>,
) -> Arc<dyn PathInfoService> {
pub fn gen_pathinfo_service<BS, DS>(
blob_service: BS,
directory_service: DS,
) -> Arc<dyn PathInfoService>
where
BS: AsRef<dyn BlobService> + Send + Sync + 'static,
DS: AsRef<dyn DirectoryService> + Send + Sync + 'static,
{
Arc::new(MemoryPathInfoService::new(blob_service, directory_service))
}