| 1 |
# `wasmparser`: A WebAssembly Binary Parser |
| 2 |
|
| 3 |
**A [Bytecode Alliance](https://bytecodealliance.org/) project** |
| 4 |
|
| 5 |
[](https://crates.io/crates/wasmparser) |
| 6 |
[](https://docs.rs/wasmparser/) |
| 7 |
|
| 8 |
A simple, event-driven library for parsing WebAssembly binary files (or |
| 9 |
streams). |
| 10 |
|
| 11 |
The library reports events as they happen and only stores parsing information |
| 12 |
for a brief period of time, making it fast and memory-efficient. The |
| 13 |
event-driven model, however, has some drawbacks. If you need random access to |
| 14 |
the entire WebAssembly data-structure, this is not the right library for |
| 15 |
you. You could however, build such a data-structure using this library. |
| 16 |
|
| 17 |
To get started, create a |
| 18 |
[`Parser`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html) |
| 19 |
using |
| 20 |
[`Parser::new`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html#method.new) |
| 21 |
and then follow the examples documented for |
| 22 |
[`Parser::parse`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html#method.parse) |
| 23 |
or |
| 24 |
[`Parser::parse_all`](https://docs.rs/wasmparser/latest/wasmparser/struct.Parser.html#method.parse_all). |
| 25 |
|
| 26 |
## Documentation |
| 27 |
|
| 28 |
Documentation and examples can be found at https://docs.rs/wasmparser/ |