MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / open_at

Method open_at

src/monitor.rs:193–201  ·  view source on GitHub ↗

Open a monitor mmap at an explicit directory (for testing).

(dir: &Path)

Source from the content-addressed store, hash-verified

191
192 /// Open a monitor mmap at an explicit directory (for testing).
193 pub fn open_at(dir: &Path) -> std::io::Result<Self> {
194 let mmap_path = dir.join(MMAP_FILENAME);
195 let file = std::fs::OpenOptions::new().read(true).open(&mmap_path)?;
196 let mmap = unsafe { memmap2::Mmap::map(&file)? };
197 Ok(Self {
198 mmap,
199 dir: dir.to_path_buf(),
200 })
201 }
202
203 /// Current write index (number of entries ever written).
204 pub fn write_idx(&self) -> u64 {

Callers

nothing calls this directly

Calls 2

openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected