pub struct FsTracker { /* private fields */ }Expand description
Inline filesystem tracker producing event payloads on writes/deletes.
Thread-safe: the internal manifest is behind a Mutex.
Implementations§
Source§impl FsTracker
impl FsTracker
Sourcepub fn new(manifest: Manifest, blob_store: Arc<BlobStore>) -> Self
pub fn new(manifest: Manifest, blob_store: Arc<BlobStore>) -> Self
Create a new tracker seeded with an existing manifest state.
Sourcepub fn track_write(
&self,
rel_path: &str,
content: &[u8],
content_type: Option<String>,
) -> LagoResult<EventPayload>
pub fn track_write( &self, rel_path: &str, content: &[u8], content_type: Option<String>, ) -> LagoResult<EventPayload>
O(1) track a file write. Stores the content in the blob store,
updates the manifest, and returns a FileWrite event payload.
Sourcepub fn track_delete(&self, rel_path: &str) -> LagoResult<EventPayload>
pub fn track_delete(&self, rel_path: &str) -> LagoResult<EventPayload>
O(1) track a file deletion. Updates the manifest and returns
a FileDelete event payload.
Sourcepub fn reconcile(&self, workspace_root: &Path) -> LagoResult<Vec<EventPayload>>
pub fn reconcile(&self, workspace_root: &Path) -> LagoResult<Vec<EventPayload>>
O(n) reconciliation: snapshot the workspace, diff against the tracked manifest, update the manifest, and return event payloads for every detected change. This is the safety-net path for catching changes made outside of tracked writes.
Auto Trait Implementations§
impl !Freeze for FsTracker
impl RefUnwindSafe for FsTracker
impl Send for FsTracker
impl Sync for FsTracker
impl Unpin for FsTracker
impl UnsafeUnpin for FsTracker
impl UnwindSafe for FsTracker
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