pub struct Watcher { /* private fields */ }Expand description
File watcher for monitoring codebase changes.
The Watcher spawns a background task that monitors the specified
directory and emits events via a channel. Events are consumed by
the incremental indexer for hot-reload capability.
Implementations§
Source§impl Watcher
impl Watcher
Sourcepub fn new(
store: Arc<UnifiedGraphStore>,
sender: UnboundedSender<WatchEvent>,
) -> Watcher
pub fn new( store: Arc<UnifiedGraphStore>, sender: UnboundedSender<WatchEvent>, ) -> Watcher
Creates a new watcher instance.
§Arguments
store- The graph store for event correlationsender- Channel to send watch events
Sourcepub async fn start(&self, path: PathBuf) -> Result<(), Error>
pub async fn start(&self, path: PathBuf) -> Result<(), Error>
Starts watching the specified directory.
Spawns a background task that recursively watches the directory and emits events for file system changes.
§Arguments
path- Directory path to watch
§Returns
Ok(()) if watching started successfully, or an error.
§Errors
Returns an error if the directory cannot be watched.
Sourcepub fn channel() -> (UnboundedSender<WatchEvent>, UnboundedReceiver<WatchEvent>)
pub fn channel() -> (UnboundedSender<WatchEvent>, UnboundedReceiver<WatchEvent>)
Creates a new channel pair for watch events.
§Returns
A tuple of (sender, receiver) for watch events.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Watcher
impl !UnwindSafe for Watcher
impl Freeze for Watcher
impl Send for Watcher
impl Sync for Watcher
impl Unpin for Watcher
impl UnsafeUnpin for Watcher
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more