Write a provenance graph to a writer (e.g., a file).
(&self, writer: &mut W)
| 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 | /// |