about summary refs log tree commit diff
path: root/tvix/store/src/pathinfoservice/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-11-13T09·40+0200
committerflokli <flokli@flokli.de>2023-11-15T06·43+0000
commit8111caebc2bb36ebad9c5be9738ad37ca963bd90 (patch)
tree1ba35408a5cc441d7b1bd155e8ca50d7b74a1404 /tvix/store/src/pathinfoservice/mod.rs
parentabe099b6ba053beaad2c1cb6fc01179578651920 (diff)
refactor(tvix/store): remove from_url from PathInfoService trait r/7014
We don't gain much from making this part of the trait, it's still up to
`tvix_store::pathinfoservice::from_addr` to do most of the construction.

Move it out of the trait and into the specific *Service impls directly.

This allows further refactorings in followup CLs.

Change-Id: I99b93ef4acd83637a2f4888a1e586f1ca96390dc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10022
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Diffstat (limited to 'tvix/store/src/pathinfoservice/mod.rs')
-rw-r--r--tvix/store/src/pathinfoservice/mod.rs18
1 files changed, 1 insertions, 17 deletions
diff --git a/tvix/store/src/pathinfoservice/mod.rs b/tvix/store/src/pathinfoservice/mod.rs
index af7bbc9f88e4..3fde10179b36 100644
--- a/tvix/store/src/pathinfoservice/mod.rs
+++ b/tvix/store/src/pathinfoservice/mod.rs
@@ -3,13 +3,9 @@ mod grpc;
 mod memory;
 mod sled;
 
-use std::pin::Pin;
-use std::sync::Arc;
-
 use futures::Stream;
+use std::pin::Pin;
 use tonic::async_trait;
-use tvix_castore::blobservice::BlobService;
-use tvix_castore::directoryservice::DirectoryService;
 use tvix_castore::proto as castorepb;
 use tvix_castore::Error;
 
@@ -23,18 +19,6 @@ pub use self::sled::SledPathInfoService;
 /// The base trait all PathInfo services need to implement.
 #[async_trait]
 pub trait PathInfoService: Send + Sync {
-    /// Create a new instance by passing in a connection URL, as well
-    /// as instances of a [PathInfoService] and [DirectoryService] (as the
-    /// [PathInfoService] needs to talk to them).
-    /// TODO: check if we want to make this async, instead of lazily connecting
-    fn from_url(
-        url: &url::Url,
-        blob_service: Arc<dyn BlobService>,
-        directory_service: Arc<dyn DirectoryService>,
-    ) -> Result<Self, Error>
-    where
-        Self: Sized;
-
     /// Retrieve a PathInfo message by the output digest.
     async fn get(&self, digest: [u8; 20]) -> Result<Option<PathInfo>, Error>;