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

Method write_to

atomic-core/src/change/attestation.rs:250–255  ·  view source on GitHub ↗

Write an attestation to a writer (e.g., a file).

(&self, writer: &mut W)

Source from the content-addressed store, hash-verified

248
249 /// Write an attestation to a writer (e.g., a file).
250 pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, AttestationError> {
251 let data = self.serialize()?;
252 let hash = Hash::of(&data);
253 writer.write_all(&data).map_err(AttestationError::Io)?;
254 Ok(hash)
255 }
256
257 /// Check whether a byte slice looks like an attestation file.
258 ///

Callers 1

Calls 1

serializeMethod · 0.45

Tested by

no test coverage detected