pub struct FileTracker { /* private fields */ }Expand description
Tracks when files were last read/written.
Enforces a read-before-write guard: rejects edits to files whose on-disk
mtime has changed since the last recorded read. Shared across read, write,
edit, and patch tools via Arc<FileTracker>.
Uses parking_lot::RwLock (not tokio) because locks are never held across
.await points; parking_lot is adopted on this hot path (every read/
write/edit/patch tool call) for ~2× faster uncontended reads, see T2 in
tasks/performance-audit-heartbit-core-2026-05-06.md.
Implementations§
Source§impl FileTracker
impl FileTracker
pub fn new() -> Self
Sourcepub fn record_read(&self, path: &Path) -> Result<()>
pub fn record_read(&self, path: &Path) -> Result<()>
Record that path was just read. Captures its current mtime.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileTracker
impl !RefUnwindSafe for FileTracker
impl Send for FileTracker
impl Sync for FileTracker
impl Unpin for FileTracker
impl UnsafeUnpin for FileTracker
impl UnwindSafe for FileTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more