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

Function read_str

src/monitor.rs:174–178  ·  view source on GitHub ↗
(mmap: &memmap2::Mmap, offset: usize)

Source from the content-addressed store, hash-verified

172}
173
174fn read_str(mmap: &memmap2::Mmap, offset: usize) -> String {
175 let bytes = &mmap[offset..offset + FIELD_LEN];
176 let end = bytes.iter().position(|&b| b == 0).unwrap_or(FIELD_LEN);
177 String::from_utf8_lossy(&bytes[..end]).to_string()
178}
179
180impl MmapReader {
181 /// Open the global monitor mmap for reading.

Callers 1

entryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected