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

Function slot_offset

nodedb-wal/src/double_write.rs:127–129  ·  view source on GitHub ↗

Byte offset of slot `idx` within the DWB file.

(idx: u32)

Source from the content-addressed store, hash-verified

125
126/// Byte offset of slot `idx` within the DWB file.
127fn slot_offset(idx: u32) -> u64 {
128 DWB_HEADER_STRIDE as u64 + (idx as u64 % DWB_CAPACITY as u64) * DWB_SLOT_STRIDE as u64
129}
130
131/// Double-write buffer file.
132pub struct DoubleWriteBuffer {

Callers 2

write_record_deferredMethod · 0.85
recover_recordMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected