pub trait WorkspaceWatcher:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn watch<'life0, 'life1, 'async_trait>(
&'life0 self,
root: &'life1 WorkspaceRoot,
) -> Pin<Box<dyn Future<Output = Result<WatchHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Watches a workspace root for file changes.
Implementations publish WorkspaceChange events to a per-root broadcast
channel. The memory double (for tests) pushes synthetic changes; the Tauri
adapter wraps notify.
Required Methods§
Sourcefn watch<'life0, 'life1, 'async_trait>(
&'life0 self,
root: &'life1 WorkspaceRoot,
) -> Pin<Box<dyn Future<Output = Result<WatchHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn watch<'life0, 'life1, 'async_trait>(
&'life0 self,
root: &'life1 WorkspaceRoot,
) -> Pin<Box<dyn Future<Output = Result<WatchHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start watching root. The returned WatchHandle yields change events.
Calling watch on an already-watched root may return a new handle to the
same channel — implementations may deduplicate internally.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".