Trait ClipboardWatcher

Source
pub trait ClipboardWatcher<T: ClipboardHandler>: Send {
    // Required methods
    fn add_handler(&mut self, handler: T) -> &mut Self;
    fn start_watch(&mut self);
    fn get_shutdown_channel(&self) -> WatcherShutdown;
}

Required Methods§

Source

fn add_handler(&mut self, handler: T) -> &mut Self

zh: 添加一个剪切板变化处理器,可以添加多个处理器,处理器需要实现 ClipboardHandler 这个trait en: Add a clipboard change handler, you can add multiple handlers, the handler needs to implement the trait ClipboardHandler

Source

fn start_watch(&mut self)

zh: 开始监视剪切板变化,这是一个阻塞方法,直到监视结束,或者调用了stop方法,所以建议在单独的线程中调用 en: Start monitoring clipboard changes, this is a blocking method, until the monitoring ends, or the stop method is called, so it is recommended to call it in a separate thread

Source

fn get_shutdown_channel(&self) -> WatcherShutdown

zh: 获得停止监视的通道,可以通过这个通道停止监视 en: Get the channel to stop monitoring, you can stop monitoring through this channel

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§