Skip the payload for a header, seeking forward without reading. This is the key optimization: non-matching records skip I/O entirely.
(&mut self, header: &RecordHeader)
| 149 | /// |
| 150 | /// This is the key optimization: non-matching records skip I/O entirely. |
| 151 | pub fn skip_payload(&mut self, header: &RecordHeader) -> Result<()> { |
| 152 | let len = header.payload_len as u64; |
| 153 | if len > 0 { |
| 154 | self.file |
| 155 | .seek(SeekFrom::Current(len as i64)) |
| 156 | .map_err(WalError::Io)?; |
| 157 | self.offset += len; |
| 158 | } |
| 159 | Ok(()) |
| 160 | } |
| 161 | |
| 162 | /// Current file offset. |
| 163 | pub fn offset(&self) -> u64 { |
no outgoing calls