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

Method write_to

atomic-core/src/change/provenance_graph/mod.rs:337–342  ·  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

335
336 /// Write a provenance graph to a writer (e.g., a file).
337 pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, ProvenanceGraphError> {
338 let data = self.serialize()?;
339 let hash = Hash::of(&data);
340 writer.write_all(&data).map_err(ProvenanceGraphError::Io)?;
341 Ok(hash)
342 }
343
344 /// Check whether a byte slice looks like a provenance graph file.
345 ///

Callers 1

Calls 1

serializeMethod · 0.45

Tested by 1