Struct debounce::thread::MixedEventDebouncer
source · pub struct MixedEventDebouncer<T>(_);
Expand description
Threaded debouncer wrapping MixedEventBuffer. Accepts a callback function which is going to be called by a background thread with debounced events. The delay is specified separately for each event as an argument to MixedEventBuffer::put().
Implementations§
source§impl<T: Eq> MixedEventDebouncer<T>
impl<T: Eq> MixedEventDebouncer<T>
pub fn new<F>(f: F) -> Selfwhere F: FnMut(T) + Send + 'static, T: Send + 'static,
pub fn put(&self, data: T, delay: Duration)
sourcepub fn stop(self) -> JoinHandle<()>
pub fn stop(self) -> JoinHandle<()>
Signals the debouncer thread to quit and returns a
std::thread::JoinHandle which can be .join()
ed in the consumer
thread. The common idiom is: debouncer.stop().join().unwrap();
Auto Trait Implementations§
impl<T> !RefUnwindSafe for MixedEventDebouncer<T>
impl<T> Send for MixedEventDebouncer<T>where T: Send,
impl<T> Sync for MixedEventDebouncer<T>where T: Send,
impl<T> Unpin for MixedEventDebouncer<T>
impl<T> !UnwindSafe for MixedEventDebouncer<T>
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