#web-codecs #message #api #web-message

web-message

A macro that converts Rust structs to/from JavaScript objects via postMessage

2 releases

Uses new Rust 2024

new 0.0.2 May 9, 2025
0.0.1 Apr 8, 2025

#1537 in Web programming

Download history 98/week @ 2025-04-06 22/week @ 2025-04-13 2/week @ 2025-04-20 52/week @ 2025-05-04

81 downloads per month

MIT/Apache

13KB
244 lines

web-rs

Rust bindings to make WASM more tolerable.

Unstable API

Some crates use unstable web_sys APIs and you may need to set --cfg=web_sys_unstable_apis when compiling. For more information, see the web-sys docs.

There's a few ways to set this depending on the environment:

web-codecs

web-codecs provides a wrapper around the WebCodecs API.

The callbacks have been replaced with a channel-like API. For example, the VideoEncoder is split into a VideoEncoder for input and a VideoEncoded for output.

web-streams

web-streams provides a wrapper around the Streams API.

This API is annoyingly untyped when using web_sys. This library handles the casting for you as well as providing guard-rails around the API (ex. closing on Drop).

Dependencies

~7–10MB
~188K SLoC