about summary refs log tree commit diff
path: root/tvix/store/src/chunkservice/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-03-15T23·56+0100
committerflokli <flokli@flokli.de>2023-03-16T13·47+0000
commit530cb920b5aadc768c0273b8150dc04fdf444359 (patch)
tree4e43afa13184dcf19d8912a1197d2097e55a65e1 /tvix/store/src/chunkservice/mod.rs
parentee23220564987771c8e7909ded6fb9853f1d1b0d (diff)
refactor(tvix/store/chunksvc): use [u8; 32] instead of Vec<u8> r/6015
Change-Id: Ie2b94aa5d69ff2c61fb77e13ae844f81f6270273
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8314
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/chunkservice/mod.rs')
-rw-r--r--tvix/store/src/chunkservice/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tvix/store/src/chunkservice/mod.rs b/tvix/store/src/chunkservice/mod.rs
index 50365caccf4a..faf0a88f151a 100644
--- a/tvix/store/src/chunkservice/mod.rs
+++ b/tvix/store/src/chunkservice/mod.rs
@@ -17,12 +17,12 @@ pub use self::util::upload_chunk;
 /// chunking information.
 pub trait ChunkService {
     /// check if the service has a chunk, given by its digest.
-    fn has(&self, digest: &[u8]) -> Result<bool, Error>;
+    fn has(&self, digest: &[u8; 32]) -> Result<bool, Error>;
 
     /// retrieve a chunk by its digest. Implementations MUST validate the digest
     /// matches.
-    fn get(&self, digest: &[u8]) -> Result<Option<Vec<u8>>, Error>;
+    fn get(&self, digest: &[u8; 32]) -> Result<Option<Vec<u8>>, Error>;
 
     /// insert a chunk. returns the digest of the chunk, or an error.
-    fn put(&self, data: Vec<u8>) -> Result<Vec<u8>, Error>;
+    fn put(&self, data: Vec<u8>) -> Result<[u8; 32], Error>;
 }