PollWatcher on wasm32-unknown-unknown target not possible with time not implemented.
System details
- OS/Platform name and version: host aarch64-apple-darwin; target wasm32-unknown-unknown
- Rust version (if building from source):
rustc --version: 1.67.0 - Notify version (or commit hash if building from git): 5.1.0
- If you're running as a privileged user (root, System): Admin
What you did (as detailed as you can)
I created a PollWatcher (either with RecommendedWatcher or directly), with any duration, and no matter what, get the error in my web console panicked at 'time not implemented on this platform', library/std/src/sys/wasm/../unsupported/time.rs:13:9
What you expected
A method for notify to function on wasm32-unknown-unknown, or an alternative library.
What happened
It threw the error panicked at 'time not implemented on this platform', library/std/src/sys/wasm/../unsupported/time.rs:13:9
Possible fix
I think this would be fixable with a feature wasm that replaces all uses std::time::Instant internally with Instant from this lib: sebcrozet/instant. It has features, and if you don't enable them it will just be a type alias to std::time::Instant::now. Note that I haven't done much look into the implementation of notify, this is purely a suggestion.