hannobraun / inotify-rs

Idiomatic inotify wrapper for the Rust programming language
ISC License
261 stars 65 forks source link

Add separate API for adding/removing watches #177

Closed hannobraun closed 2 years ago

hannobraun commented 3 years ago

Add a separate Watches struct that provides add and remove methods to replace Inotify::add_watch/Inotify::rm_watch. It should be possible to get an instance of this struct from Inotify and EventStream (for example via watches methods on each).

I think there should be no harm in making Watches completely independent (i.e. no need to borrow Inotify or EventStream) and make it Clone.

See https://github.com/hannobraun/inotify-rs/issues/112#issuecomment-850352465 and https://github.com/hannobraun/inotify-rs/issues/112#issuecomment-850418244 for more context.