12 unstable releases (5 breaking)

0.6.0 Mar 10, 2023
0.5.1 Mar 7, 2023
0.4.1 Mar 5, 2023
0.3.2 Mar 3, 2023
0.1.0 Oct 17, 2020

#287 in WebAssembly

Download history 2046/week @ 2023-08-10 946/week @ 2023-08-17 1063/week @ 2023-08-24 314/week @ 2023-08-31 809/week @ 2023-09-07 514/week @ 2023-09-14 840/week @ 2023-09-21 1166/week @ 2023-09-28 1535/week @ 2023-10-05 1156/week @ 2023-10-12 808/week @ 2023-10-19 1091/week @ 2023-10-26 1115/week @ 2023-11-02 947/week @ 2023-11-09 923/week @ 2023-11-16 755/week @ 2023-11-23

3,852 downloads per month
Used in spacetimedb-cli




wasmbin is a library implementing parsing and serialization WebAssembly binaries.

Announcement blog post: wasmbin: a self-generating WebAssembly parser & serializer.

Public API entry point: Module object. From there you can explore the module contents by simply looking up the nested fields.


This crate intends to provide a low-level representation of the WebAssembly module that is fully described by Rust type system. It also leverages the said type system in conjunction with custom proc-macros to autogenerate parsing/serialization/visitation code for any complex types (structures and enums).

On the user's side this approach allows any type can be used independently to represent/parse/serialize only part of the module, while on the maintainers' side it makes adding and testing new WebAssembly features as quick and easy as adding new types, fields, and variants, without having to write any manual code at all.

One other notable feature is a Lazy<T> wrapper used in wasmbin whenever the spec permits efficiently skipping over some contents (e.g. function bodies).

It allows minimally invasive, efficient, "zero-cost" editing of WebAssembly modules: during decoding anything that can be skipped, is skipped over lazily, and during encoding only the modified parts of the module are re-encoded, while any untouched parts are copied verbatim as raw bytes from the source.


~36K SLoC