Write a provenance graph to a writer (e.g., a file).
(&self, writer: &mut W)
| 361 | |
| 362 | /// Write a provenance graph to a writer (e.g., a file). |
| 363 | pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, ProvenanceGraphError> { |
| 364 | let data = self.serialize()?; |
| 365 | let hash = Hash::of(&data); |
| 366 | writer.write_all(&data).map_err(ProvenanceGraphError::Io)?; |
| 367 | Ok(hash) |
| 368 | } |
| 369 | |
| 370 | /// Check whether a byte slice looks like a provenance graph file. |
| 371 | /// |