pub struct Watcher { /* private fields */ }Expand description
A running watcher. Dropping it signals the thread to stop and joins it.
Implementations§
Source§impl Watcher
impl Watcher
Sourcepub fn spawn(config: Config) -> Option<Watcher>
pub fn spawn(config: Config) -> Option<Watcher>
Start the watcher unless disabled by config or RAG_RAT_NO_WATCH. The returned watcher must
be kept alive; dropping it stops the thread. Returns None when watching is disabled.
Sourcepub fn spawn_with_fleet(
config: Config,
fleet_bin: Option<PathBuf>,
) -> Option<Watcher>
pub fn spawn_with_fleet( config: Config, fleet_bin: Option<PathBuf>, ) -> Option<Watcher>
Like Watcher::spawn, but when fleet_bin is the installed-binary path, the elected
watcher also watches that file’s directory and signals the hot-upgrade fleet (see
crate::fleet) when a new binary lands. Only the MCP server — which has a SIGUSR1
handler — passes Some.
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> 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