Derive Macro wasm_bindgen_derive::TryFromJsValue
source · #[derive(TryFromJsValue)]Expand description
Derives a TryFrom<&JsValue> for a type exported using #[wasm_bindgen].
Note that:
- this derivation must be be positioned before
#[wasm_bindgen]; - the type must implement
Clone. extern crate allocmust be declared in scope.
The macro is authored by @AlexKorn based on the idea of @aweinstock314. See this and this GitHub comments.