Set the encryption key ring. All subsequent records will be encrypted. Must be called before any records are written to the active segment.
(&mut self, ring: nodedb_wal::crypto::KeyRing)
| 94 | /// |
| 95 | /// Must be called before any records are written to the active segment. |
| 96 | pub fn set_encryption_ring(&mut self, ring: nodedb_wal::crypto::KeyRing) -> crate::Result<()> { |
| 97 | let mut wal = self.wal.lock().unwrap_or_else(|p| p.into_inner()); |
| 98 | wal.set_encryption_ring(ring.clone()) |
| 99 | .map_err(crate::Error::Wal)?; |
| 100 | self.encryption_ring = Some(ring); |
| 101 | Ok(()) |
| 102 | } |
| 103 | } |
no test coverage detected