| 139 | } |
| 140 | |
| 141 | fn put_vault_manifest(&mut self, manifest: &VaultManifest) -> PristineResult<()> { |
| 142 | let bytes = serde_json::to_vec(manifest).map_err(|e| PristineError::Serialization { |
| 143 | message: format!("failed to serialize VaultManifest: {}", e), |
| 144 | })?; |
| 145 | |
| 146 | let mut table = self.txn.open_table(VAULT_MANIFEST)?; |
| 147 | table.insert("manifest", bytes.as_slice())?; |
| 148 | Ok(()) |
| 149 | } |
| 150 | |
| 151 | fn init_vault(&mut self) -> PristineResult<()> { |
| 152 | // Opening tables with a WriteTransaction creates them if they don't exist |