pub struct FileWatcher { /* private fields */ }Expand description
Watches one or more project directories and keeps the graph up to date.
Constructed with FileWatcher::new then configured via [FileWatcher::watch].
Call FileWatcher::run to start the event loop (runs until the future is
dropped or the process exits).
Implementations§
Source§impl FileWatcher
impl FileWatcher
pub fn new(graph: Arc<GraphStore>) -> Self
Sourcepub async fn add_project(&self, root: PathBuf, project: String)
pub async fn add_project(&self, root: PathBuf, project: String)
Register a project directory for watching.
This is additive - multiple directories can be registered. The actual
OS-level watch is set up when [run] is called.
Auto Trait Implementations§
impl !RefUnwindSafe for FileWatcher
impl !UnwindSafe for FileWatcher
impl Freeze for FileWatcher
impl Send for FileWatcher
impl Sync for FileWatcher
impl Unpin for FileWatcher
impl UnsafeUnpin for FileWatcher
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
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