@jesseditson I just ran into your blog post about Rust singletons in WASM and wanted to share a crate that I've used in WASM gamedev that might be useful to you:
It makes a type implement Send, but panics if you access it on another thread ( which will never happen in WASM ), and doesn't require any unsafe.
I didn't fully analyze if it'd fix all your issues, but still thought it'd be useful to know about if you haven't seen it already.
https://jesseditson.com/post/rust-singletons-in-a-service-worker
send_wrapper - Rust
This Rust library implements a wrapper type called `SendWrapper` which allows you to move around non-`Send` types between threads, as long as you access the contained value only from within the original thread. You also have to make sure that the wrapper is dropped from within the original thread. If any of these constraints is violated, a panic occurs. `SendWrapper<T>` implements `Send` and `Sync` for any type `T`.
