about summary refs log tree commit diff
path: root/tvix/store/src/directoryservice/sled.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-03-27T15·08+0200
committerclbot <clbot@tvl.fyi>2023-04-07T09·26+0000
commit0836450006e3ef3ec4f150696c164fef7eb701db (patch)
tree04306a0f9b43702177c89283e5d29da9e4c2f6c4 /tvix/store/src/directoryservice/sled.rs
parent96d7f4f0acc82bc6b12b41ac8d5fbfbd54e41599 (diff)
feat(tvix/store/directorysvc): add put_multiple_start r/6073
This provides a handle to upload multiple proto::Directory as part of
the same closure.

Change-Id: I9213dde257a260c8622239918ea541064b270484
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8356
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/directoryservice/sled.rs')
-rw-r--r--tvix/store/src/directoryservice/sled.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tvix/store/src/directoryservice/sled.rs b/tvix/store/src/directoryservice/sled.rs
index 44d61ae42ae5..d060232307b1 100644
--- a/tvix/store/src/directoryservice/sled.rs
+++ b/tvix/store/src/directoryservice/sled.rs
@@ -5,6 +5,7 @@ use prost::Message;
 use std::path::PathBuf;
 use tracing::{instrument, warn};
 
+use super::utils::SimplePutter;
 use super::{DirectoryService, DirectoryTraverser};
 
 #[derive(Clone)]
@@ -97,4 +98,14 @@ impl DirectoryService for SledDirectoryService {
     fn get_recursive(&self, root_directory_digest: &[u8; 32]) -> Self::DirectoriesIterator {
         DirectoryTraverser::with(self.clone(), root_directory_digest)
     }
+
+    type DirectoryPutter = SimplePutter<Self>;
+
+    #[instrument(skip_all)]
+    fn put_multiple_start(&self) -> Self::DirectoryPutter
+    where
+        Self: Clone,
+    {
+        SimplePutter::new(self.clone())
+    }
 }