MCPcopy Create free account
hub / github.com/RustCrypto/utils / write

Method write

digest-io/src/writer.rs:90–98  ·  view source on GitHub ↗
(&mut self, buf: &[u8])

Source from the content-addressed store, hash-verified

88
89impl<D: Digest, W: io::Write> io::Write for HashWriter<D, W> {
90 fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
91 let bytes = self.writer.write(buf)?;
92
93 if bytes > 0 {
94 self.hasher.update(&buf[0..bytes]);
95 }
96
97 Ok(bytes)
98 }
99
100 fn flush(&mut self) -> io::Result<()> {
101 self.writer.flush()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected