I'm trying to use a JS function from within rust with wasm_bindgen, the function has an object parameter similar to functions like fetch:
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen]
fn fetch(resource: &str, config: &JsValue);
}
(just using fetch as an example, I know that there are better ways to use fetch from rust...)
I'm not sure how to model the config object in rust.
I tried using JsValue but it seems that JsValue can only be created from primitive types and not from objects.
I've seen online some suggestions that serde can help here but I couldn't find any concrete examples, and my attempt to get it to work myself were not fruitful either.
Thanks in advance for looking into this!