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.