Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

39
vendor/inotify/examples/stream.rs vendored Normal file
View File

@@ -0,0 +1,39 @@
use std::{
fs::File,
io,
thread,
time::Duration,
};
use futures_util::StreamExt;
use inotify::{
Inotify,
WatchMask,
};
use tempfile::TempDir;
#[tokio::main]
async fn main() -> Result<(), io::Error> {
let inotify = Inotify::init()
.expect("Failed to initialize inotify");
let dir = TempDir::new()?;
inotify.watches().add(dir.path(), WatchMask::CREATE | WatchMask::MODIFY)?;
thread::spawn::<_, Result<(), io::Error>>(move || {
loop {
File::create(dir.path().join("file"))?;
thread::sleep(Duration::from_millis(500));
}
});
let mut buffer = [0; 1024];
let mut stream = inotify.into_event_stream(&mut buffer)?;
while let Some(event_or_error) = stream.next().await {
println!("event: {:?}", event_or_error?);
}
Ok(())
}