pub struct WatcherShutdown { /* private fields */ }
Implementations§
Source§impl WatcherShutdown
impl WatcherShutdown
Sourcepub fn stop(self)
pub fn stop(self)
zh: 停止监视 en: stop watching
Examples found in repository?
examples/watch_change.rs (line 37)
26fn main() {
27 let manager = Manager::new();
28
29 let mut watcher = ClipboardWatcherContext::new().unwrap();
30
31 let watcher_shutdown: clipboard_rs::WatcherShutdown =
32 watcher.add_handler(manager).get_shutdown_channel();
33
34 thread::spawn(move || {
35 thread::sleep(Duration::from_secs(5));
36 println!("stop watch!");
37 watcher_shutdown.stop();
38 });
39
40 println!("start watch!");
41 watcher.start_watch();
42}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WatcherShutdown
impl RefUnwindSafe for WatcherShutdown
impl Send for WatcherShutdown
impl Sync for WatcherShutdown
impl Unpin for WatcherShutdown
impl UnwindSafe for WatcherShutdown
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