pub struct WatcherHandle {
pub directory: PathBuf,
pub table: String,
pub target_db: Option<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§target_db: Option<String>Resolved target database alias for this watcher. None →
primary; Some("persistent") → persistent attachment;
Some(alias) → user-attached writable. Stored so the
post-reconnect rebuild path resolves to the same target,
and so detach_database can refuse to detach an alias with
an active watcher.
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 !RefUnwindSafe for WatcherHandle
impl !UnwindSafe for WatcherHandle
impl Freeze for WatcherHandle
impl Send for WatcherHandle
impl Sync for WatcherHandle
impl Unpin for WatcherHandle
impl UnsafeUnpin 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
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>
T in a tonic::Request