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

Method open

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

Open a WAL file for lazy reading.

(path: &Path)

Source from the content-addressed store, hash-verified

42impl LazyWalReader {
43 /// Open a WAL file for lazy reading.
44 pub fn open(path: &Path) -> Result<Self> {
45 let file = File::open(path)?;
46 let dwb_path = path.with_extension("dwb");
47 let double_write = if dwb_path.exists() {
48 crate::double_write::DoubleWriteBuffer::open(
49 &dwb_path,
50 crate::double_write::DwbMode::Buffered,
51 )
52 .ok()
53 } else {
54 None
55 };
56 Ok(Self {
57 file,
58 offset: 0,
59 double_write,
60 })
61 }
62
63 /// Read the next record header (30 bytes) without reading the payload.
64 ///

Callers

nothing calls this directly

Calls 3

openFunction · 0.50
existsMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected