Crate fibers_inotify

Crate fibers_inotify 

Source
Expand description

A futures friendly inotify wrapper for fibers crate.

§Examples

Watches /tmp directory:

use fibers::{Executor, InPlaceExecutor, Spawn};
use fibers_inotify::{InotifyService, WatchMask};
use futures::{Future, Stream};

let inotify_service = InotifyService::new();
let inotify_handle = inotify_service.handle();

let mut executor = InPlaceExecutor::new().unwrap();
executor.spawn(inotify_service.map_err(|e| panic!("{}", e)));

executor.spawn(
   inotify_handle
       .watch("/tmp/", WatchMask::CREATE | WatchMask::DELETE)
       .for_each(|event| Ok(println!("# EVENT: {:?}", event)))
       .map_err(|e| panic!("{}", e)),
   );

executor.run_once().unwrap();

Re-exports§

pub use inotify::EventMask;
pub use inotify::WatchMask;

Structs§

Error
This crate specific Error type.
InotifyEvent
Event notified by inotify.
InotifyService
Inotify service.
InotifyServiceHandle
Handle of InotifyService.
Watcher
Inotify event watcher.

Enums§

ErrorKind
Possible error kinds.
WatcherEvent
Event produced by Watcher.

Type Aliases§

Result
This crate specific Result type.