Write the footer to a file.
(&self, path: &Path)
| 97 | |
| 98 | /// Write the footer to a file. |
| 99 | pub fn write_to(&self, path: &Path) -> crate::Result<()> { |
| 100 | let mut file = std::fs::OpenOptions::new().append(true).open(path)?; |
| 101 | file.write_all(&self.to_bytes())?; |
| 102 | file.flush()?; |
| 103 | Ok(()) |
| 104 | } |
| 105 | |
| 106 | /// Read the footer from the end of a file. |
| 107 | pub fn read_from(path: &Path) -> crate::Result<Self> { |