pub struct HotReloadHandle { /* private fields */ }Expand description
Handle for controlling the hot-reload background thread.
Returned by HotReloadConfig::start_watching. Dropping the
handle (or calling HotReloadHandle::stop) signals the worker
to exit and tears down the kernel-level watch registration.
Holding the handle keeps the watcher alive.
New handlers can be registered after start_watching via
HotReloadHandle::on_change — the handler list is shared
between the original HotReloadConfig and the spawned worker
thread.
Implementations§
Source§impl HotReloadHandle
impl HotReloadHandle
Sourcepub fn on_change<F>(&self, handler: F) -> Subscription
pub fn on_change<F>(&self, handler: F) -> Subscription
Register a change handler after start_watching has been
called.
Semantics match HotReloadConfig::on_change. Useful when
the consumer of the handle is a different component from
whoever called start_watching — pass the handle around and
let each component install its own handler.
Trait Implementations§
Source§impl Drop for HotReloadHandle
impl Drop for HotReloadHandle
Auto Trait Implementations§
impl Freeze for HotReloadHandle
impl !RefUnwindSafe for HotReloadHandle
impl Send for HotReloadHandle
impl Sync for HotReloadHandle
impl Unpin for HotReloadHandle
impl UnsafeUnpin for HotReloadHandle
impl !UnwindSafe for HotReloadHandle
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