#derive Conversion for Rust Struct <-> Js Value

Is there a derive macro for doing Rust Struct <-> JsValue auto conversions ?

Note: I'm asking for JsValue, not Json.

We can not stuff a MessagePort into json, but we can stuff a MessagePort into a JsValue and do Rust / JS FFI.

I am looking for JSvalue, not Json, so we can do these 'objects'.

Thanks!

Yes. Arbitrary Data with Serde - The `wasm-bindgen` Guide

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.