Enhance VFS watch functionality and introduce recording mode

- Updated the `watch` method in `VfsBackend` to accept a `recursive` parameter, allowing for more flexible directory watching.
- Implemented a recording mode in the `Vfs` struct to track accessed paths without immediately watching them, improving performance during read operations.
- Added tests to verify the behavior of the new recording mode and ensure correct path tracking.
- Enhanced the `StdBackend` and `NoopBackend` implementations to support the updated watch functionality.

These changes aim to improve the VFS's ability to manage file system events and enhance user control over watching behavior.
This commit is contained in:
Joe 2026-03-06 17:25:38 -06:00
parent bfb5815f5e
commit 2ea1d49316
8 changed files with 486 additions and 56 deletions

View file

@ -155,6 +155,8 @@ pub struct InstanceContext {
pub path_ignore_rules: Arc<Vec<PathIgnoreRule>>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub sync_rules: Vec<SyncRule>,
#[serde(skip)]
pub sync_scripts_only: bool,
}
impl InstanceContext {
@ -162,6 +164,7 @@ impl InstanceContext {
Self {
path_ignore_rules: Arc::new(Vec::new()),
sync_rules: Vec::new(),
sync_scripts_only: false,
}
}