108 Commits

Author SHA1 Message Date
Aron Heinecke 6077ef019a run nix test not on windows 2022-04-29 01:30:10 +02:00
jasta 3e8875e024 Removed leftover println debugging 2022-04-29 01:30:10 +02:00
jasta 70ec3639ac Apply cargo fmt 2022-04-29 01:30:10 +02:00
jasta 1cd31ce047 Modify PollWatcher to support pseudo filesystems like sysfs/procfs
Technically this means that you can now construct an instance of
PollWatcher that performs full file contents hashing to augment the
mtime comparison.  This works well for pseudo filesystems that often
don't adhere to durable filesystem metadata norms like accurate file
sizes, modification times, etc.

Closes #391
2022-04-29 01:30:10 +02:00
Jasper Bekkers ec249d9070 Discard Result<> from spawn whenever a JoinHandle isn't required 2022-02-14 22:33:07 +01:00
Jasper Bekkers 833ee36cb5 cargo fmt 2022-02-14 22:33:07 +01:00
Jasper Bekkers 139cbbba78 Specify a name for every thread notify creates 2022-02-14 22:33:07 +01:00
Travis Finkenauer 0697fae498 Format and fix clippy warning (#379) 2022-01-09 03:25:38 +09:00
Erick Tryzelaar 1600b5329a Make Watcher object safe
This changes the `Watcher` trait to be object safe, which allows users to
dynamically select which backend to use. This can be helpful on systems that
support multiple file watching systems that have different tradeoffs. For
example, Chromium's file watcher on OS X will use an fsevent backend
when watching recursive directories, and a kqueues backend when not.

In order to implement this, this makes a few changes to Watcher:

* removes `new_immediate` constructor.
* removes the `<P: AsRef<Path>>` from the `watch` and `unwatch`.

This then replaces (and renames) calls with `notify::recommended_watcher()`
to get similar behavior as the old constructor.
2021-06-10 20:32:00 +02:00
Erick Tryzelaar 3a889bcae4 Use tempfile to make tempdirs
This avoids accidentally including non-hermetic data in tests.
2021-05-13 10:24:28 +02:00
Erick Tryzelaar 29fb733b2f Remove anymap
`anymap` has some undefined behavior, and appears to no longer be maintained.
This patch replaces anymap with an opaque `EventAttributes` type, which
contains a number of accessor methods to get and set values. Under the
covers, this type is simply a box of a struct of option types. However,
since it's opaque the underlying type could be swapped out with an
alternative type that can be extended to support more attributes without
breaking users.

Closes #306
2021-05-12 12:24:43 +02:00
Jason Orendorff 86421e513e Check for errors from str_path_to_cfstring_ref.
Closes #301.
2021-05-04 11:43:15 +02:00
Yuki Okushi 6b41307424 Fix/suppress warnings 2020-07-04 11:49:00 +02:00
Félix Saparelli 4bbbb08710 [tests] Fix serde tests 2019-06-30 03:12:17 +12:00
Félix Saparelli 2668c20452 [tests] Remove most tests 2019-06-30 03:12:17 +12:00
Félix Saparelli 8320d06817 [ci] Auto-retry only failed tests up to three times 2019-05-08 13:42:17 +12:00
Félix Saparelli bdfdbd42a4 [errors] Augment errors to carry paths, and wire up debounced errors 2019-04-21 23:52:28 +12:00
Félix Saparelli 0ffb389847 [tests] Sort dual event received to ensure results 2019-04-20 23:48:23 +12:00
Félix Saparelli 2a035c86c5 [dual] Explicitely support more than one watcher on a channel 2019-04-20 22:56:41 +12:00
Félix Saparelli 9a46afb4f1 [tests] Stop ignoring tests that failed on Appveyor 2019-04-20 22:35:55 +12:00
Félix Saparelli 19977214f0 [compat] Avoid crate:: for 1.26 2019-04-19 12:13:25 +12:00
Félix Saparelli 9199348ff9 [tests] Fix translation mistake 2019-04-19 00:33:42 +12:00
Félix Saparelli 804b3bd526 [tests] Add event serialisation tests
Pulled from the `next` branch.
2019-04-19 00:11:52 +12:00
Félix Saparelli 2caa665b07 [events] Promote ongoing and notice to Flags 2019-04-18 23:54:10 +12:00
Félix Saparelli ed83198775 [events] Allow multiple paths on a single event 2019-04-18 23:18:42 +12:00