Registry / serialization / serde-wasm-bindgen

serde-wasm-bindgen

JSON →
library0.6.5rscratesunverified

Native Serde adapter for wasm-bindgen, enabling serialization/deserialization between Rust and JavaScript.

# Cargo.toml [dependencies] serde-wasm-bindgen = "0.6.5"
INSTALL
IMPORT
SIG · SERDE-WASM-BINDGEN
S
serde-wasm-bindgen
serializationrustv0.6.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from_value
use serde_wasm_bindgen::from_value;

Deserializes a JavaScript value into a Rust struct using Serde.

use wasm_bindgen::prelude::*; use serde::{Deserialize, Serialize}; use serde_wasm_bindgen::from_value; #[wasm_bindgen] pub fn process(data: JsValue) -> JsValue { let input: MyStruct = from_value(data).unwrap(); // ... JsValue::NULL } #[derive(Deserialize)] struct MyStruct { name: String, }
Debug
Known issues
gotchaRequires the 'wasm-bindgen' feature and a WebAssembly target; not usable in native Rust.
fix
Ensure you are compiling for wasm32-unknown-unknown and have wasm-bindgen as a dependency.
affects: >=0.4.0
Upgrade
Version history
0.6.5latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
serde-wasm-bindgen — cargo add serde-wasm-bindgen · libregistry