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

Method write_to

atomic-core/src/change/attestation.rs:487–492  ·  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

485
486 /// Write an attestation to a writer (e.g., a file).
487 pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, AttestationError> {
488 let data = self.serialize()?;
489 let hash = Hash::of(&data);
490 writer.write_all(&data).map_err(AttestationError::Io)?;
491 Ok(hash)
492 }
493
494 /// Check whether a byte slice looks like an attestation file.
495 ///

Callers 1

Calls 1

serializeMethod · 0.45

Tested by

no test coverage detected