about summary refs log tree commit diff
path: root/tvix/store/src/directoryservice/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-03-15T23·01+0100
committerflokli <flokli@flokli.de>2023-03-16T13·47+0000
commitee23220564987771c8e7909ded6fb9853f1d1b0d (patch)
treeb1c99097c8912642c9f3582adebff49f9caa3093 /tvix/store/src/directoryservice/mod.rs
parent9c08cbc9732710a0003cb7bbe0ff7a9950fc22b6 (diff)
refactor(tvix/store/directorysvc): use [u8; 32] instead of Vec<u8> r/6014
Also, simplify the trait interface, only allowing lookups of Directory
objects by their digest.

Change-Id: I6eec28a8cb0557bed9b69df8b8ff99a5e0f8fe35
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8313
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/store/src/directoryservice/mod.rs')
-rw-r--r--tvix/store/src/directoryservice/mod.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/tvix/store/src/directoryservice/mod.rs b/tvix/store/src/directoryservice/mod.rs
index 4abf823b23b4..a27f6745332a 100644
--- a/tvix/store/src/directoryservice/mod.rs
+++ b/tvix/store/src/directoryservice/mod.rs
@@ -11,11 +11,8 @@ pub use self::sled::SledDirectoryService;
 pub trait DirectoryService {
     /// Get looks up a single Directory message by its digest.
     /// In case the directory is not found, Ok(None) is returned.
-    fn get(
-        &self,
-        by_what: &proto::get_directory_request::ByWhat,
-    ) -> Result<Option<proto::Directory>, Error>;
+    fn get(&self, digest: &[u8; 32]) -> Result<Option<proto::Directory>, Error>;
     /// Get uploads a single Directory message, and returns the calculated
     /// digest, or an error.
-    fn put(&self, directory: proto::Directory) -> Result<Vec<u8>, Error>;
+    fn put(&self, directory: proto::Directory) -> Result<[u8; 32], Error>;
 }