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.
Add a separate
Watches
struct that providesadd
andremove
methods to replaceInotify::add_watch
/Inotify::rm_watch
. It should be possible to get an instance of this struct fromInotify
andEventStream
(for example viawatches
methods on each).I think there should be no harm in making
Watches
completely independent (i.e. no need to borrowInotify
orEventStream
) and make itClone
.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.