amethystate 0.9.1

Type-safe reactive persistence for Rust GUI apps
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::sync::{Arc, Condvar, Mutex};

pub mod debouncer;
pub mod ticker;

struct DeadNotifier(Arc<(Mutex<bool>, Condvar)>);

impl Drop for DeadNotifier {
    fn drop(&mut self) {
        let (lock, cvar) = &*self.0;
        *lock.lock().unwrap() = true;
        cvar.notify_all();
    }
}