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

Method read_from

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

239
240 /// Read an attestation from a reader (e.g., a file).
241 pub fn read_from<R: Read>(reader: &mut R) -> Result<(Self, Hash), AttestationError> {
242 let mut data = Vec::new();
243 reader
244 .read_to_end(&mut data)
245 .map_err(AttestationError::Io)?;
246 Self::deserialize(&data)
247 }
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> {

Callers

nothing calls this directly

Calls 1

deserializeFunction · 0.85

Tested by

no test coverage detected