MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / DigestWriter

Class DigestWriter

atomic-agent/src/record/scope.rs:64–64  ·  view source on GitHub ↗

`digest` 0.11 removed its `std::io` impls and its `std` feature, moving them to the separate `digest-io` crate (RustCrypto/traits#1809), so streaming bytes into a hasher needs a wrapper again. Kept local instead of taking a dependency for one `Write` impl; equivalent to `digest_io::IoWrapper`.

Source from the content-addressed store, hash-verified

62/// taking a dependency for one `Write` impl; equivalent to
63/// `digest_io::IoWrapper`.
64struct DigestWriter<'a, D>(&'a mut D);
65
66impl<D: Digest> std::io::Write for DigestWriter<'_, D> {
67 fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {

Callers 1

fingerprintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected