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