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

Method read_from

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

Read an attestation from a reader (e.g., a file).

(reader: &mut R)

Source from the content-addressed store, hash-verified

476
477 /// Read an attestation from a reader (e.g., a file).
478 pub fn read_from<R: Read>(reader: &mut R) -> Result<(Self, Hash), AttestationError> {
479 let mut data = Vec::new();
480 reader
481 .read_to_end(&mut data)
482 .map_err(AttestationError::Io)?;
483 Self::deserialize(&data)
484 }
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> {

Callers

nothing calls this directly

Calls 1

deserializeFunction · 0.50

Tested by

no test coverage detected