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

Method write_to

atomic-core/src/change/provenance_graph/mod.rs:371–376  ·  view source on GitHub ↗

Write a provenance graph to a writer (e.g., a file).

(&self, writer: &mut W)

Source from the content-addressed store, hash-verified

369
370 /// Write a provenance graph to a writer (e.g., a file).
371 pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, ProvenanceGraphError> {
372 let data = self.serialize()?;
373 let hash = Hash::of(&data);
374 writer.write_all(&data).map_err(ProvenanceGraphError::Io)?;
375 Ok(hash)
376 }
377
378 /// Check whether a byte slice looks like a provenance graph file.
379 ///

Callers 1

Calls 1

serializeMethod · 0.45

Tested by 1