MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / skip_payload

Method skip_payload

nodedb-wal/src/lazy_reader.rs:151–160  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 {

Callers 2

lazy_skip_non_matchingFunction · 0.80

Calls

no outgoing calls

Tested by 2

lazy_skip_non_matchingFunction · 0.64