diff options
author | Florian Klink <flokli@flokli.de> | 2024-03-03T12·46+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-03-03T15·31+0000 |
commit | 4b4443240e45c5200d3135acccd4e52ffa8d706c (patch) | |
tree | a483c9b14d8d862189956e418d5664a5e034087f /tvix/castore/src/lib.rs | |
parent | 8383e9e02e1f762013a652e9a842493a1be5bb60 (diff) |
feat(tvix/castore): add HashingReader, B3HashingReader r/7641
HashingReader wraps an existing AsyncRead, and allows querying for the digest of all data read "through" it. The hash function is configurable by type parameter, and we define B3HashingReader. Change-Id: Ic08142077566fc08836662218f5ec8c3aff80be5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11087 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/castore/src/lib.rs')
-rw-r--r-- | tvix/castore/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tvix/castore/src/lib.rs b/tvix/castore/src/lib.rs index 8da0edef786b..dec7684b4c57 100644 --- a/tvix/castore/src/lib.rs +++ b/tvix/castore/src/lib.rs @@ -1,5 +1,6 @@ mod digests; mod errors; +mod hashing_reader; pub mod blobservice; pub mod directoryservice; @@ -15,6 +16,7 @@ pub mod utils; pub use digests::{B3Digest, B3_LEN}; pub use errors::Error; +pub use hashing_reader::{B3HashingReader, HashingReader}; #[cfg(test)] mod tests; |