Open a WAL segment for lazy reading and iterate with a callback. Convenience function for single-pass replay: the callback receives each header and decides whether to read or skip the payload.
(path: &Path, mut handler: F)
| 176 | /// Convenience function for single-pass replay: the callback receives each |
| 177 | /// header and decides whether to read or skip the payload. |
| 178 | pub fn replay_segment_lazy<F>(path: &Path, mut handler: F) -> Result<()> |
| 179 | where |
| 180 | F: FnMut(&mut LazyWalReader, &RecordHeader) -> Result<()>, |
| 181 | { |
| 182 | let mut reader = LazyWalReader::open(path)?; |
| 183 | while let Some(header) = reader.next_header()? { |
| 184 | handler(&mut reader, &header)?; |
| 185 | } |
| 186 | Ok(()) |
| 187 | } |
| 188 | |
| 189 | /// Replay all WAL segments in a directory with lazy reading. |
| 190 | /// |
no test coverage detected