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

Function read_from_offset

src/analytics_bridge.rs:177–187  ·  view source on GitHub ↗
(path: &Path, offset: u64)

Source from the content-addressed store, hash-verified

175}
176
177fn read_from_offset(path: &Path, offset: u64) -> Result<String, String> {
178 use std::io::{Read, Seek, SeekFrom};
179 let mut file =
180 std::fs::File::open(path).map_err(|err| format!("open {}: {err}", path.display()))?;
181 file.seek(SeekFrom::Start(offset))
182 .map_err(|err| format!("seek {}: {err}", path.display()))?;
183 let mut text = String::new();
184 file.read_to_string(&mut text)
185 .map_err(|err| format!("read {}: {err}", path.display()))?;
186 Ok(text)
187}
188
189fn hook_row_to_analytics_event(
190 line: &str,

Callers 1

import_sourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected