pub struct WatcherHandle {
pub directory: PathBuf,
pub table: String,
pub stats: Arc<Mutex<WatcherStats>>,
/* private fields */
}Expand description
Owns the notify watcher, the async ingest task, and the connection pool for one watched directory.
Dropping the handle stops the watcher cleanly: the Option<Watcher> is
taken first, which drops the sender end of the mpsc channel, which causes
the worker task’s recv() to return None, which ends the loop. We then
abort the task just in case (the JoinHandle is dropped non-blockingly —
the task has no cancellation-point awaits after recv()’s loop ends so
it completes naturally).
Fields§
§directory: PathBuf§table: String§stats: Arc<Mutex<WatcherStats>>Trait Implementations§
Source§impl Debug for WatcherHandle
impl Debug for WatcherHandle
Source§impl Drop for WatcherHandle
impl Drop for WatcherHandle
Auto Trait Implementations§
impl Freeze for WatcherHandle
impl !RefUnwindSafe for WatcherHandle
impl Send for WatcherHandle
impl Sync for WatcherHandle
impl Unpin for WatcherHandle
impl UnsafeUnpin for WatcherHandle
impl !UnwindSafe for WatcherHandle
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request