inotify-rs
let mut notify = Inotify::init().expect("failed to initialise Inotify structure");
notify
.add_watch(&path, WatchMask::MOVE)
.expect(&format!("failed to watch directory {:?}", path));
kqueue
let mut watcher = kqueue::Watcher::new()?;
watcher.add_filename(path, kqueue::EventFilter::EVFILT_VNODE, kqueue::FilterFlag::NOTE_RENAME)?;
async-io
provides a Timer
typeuse async_io::Timer;
use std::time::Duration;
Timer::after(Duration::from_secs(1)).await;