If you only need to keep the object in your Rust part, do what @comex says. If you pass pointers back into JavaScript land, they are automatically turned into integers, which are just indices into the WebAssembly memory buffer. These integers can be passed back as pointers into Rust code. Modifying Rust objects from the JavaScript side is not recommended though.
I thought an immutable was immutable, I guess not .
Now I just need to bash RefCell with a hammer until it works. Thread if you wanna join in: https://users.rust-lang.org/t/static-allocation-for-webassembly-with-refcell/14420
cc @jer
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.