Hi,
Anyone have a working example on how to do:
Bincode is a crate for encoding and decoding using a tiny binary serialization strategy. Using it, you can easily go from having an object in memory, quickly serialize it to bytes, and then deserialize it back just as fast!
I literally need the same thing than the serialization here but in JS.
let encoded: Vec<u8> = serialize(&target, limit).unwrap();
After that, i'll send it through websockets and receiver (Rust server) will deserialize it (with bincode)
Thanks guys!
When I checked a couple months ago, there didn't appear to be any implementations of bincode
in other languages (it's not an existing standard, but a Rust thing from Servo). Consider using serde_json
to pass data to JavaScript.
I believe you can use wasm-bindgen and process the array buffer of the response result from a fetch request .
1 Like
system
Closed
August 11, 2019, 6:04pm
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.