13 个版本 (7 个重大更改)
| 0.7.0 | 2024 年 5 月 15 日 |
|---|---|
| 0.6.0 | 2024 年 3 月 27 日 |
| 0.1.0 | 2023 年 12 月 27 日 |
#960 in WebAssembly
每月 51 次下载
用于 tinywasm
84KB
1.5K SLoC
tinywasm-parser
此 crate 提供了一个解析器,可以将 WebAssembly 模块解析成 TinyWasm 模块。它使用经过修改以兼容 no_std 环境的 我的分支 的 wasmparser crate。
功能
std: 启用使用std和std::io从文件和流中解析。logging: 启用使用logcrate 记录解析过程。
用法
use tinywasm_parser::Parser;
let bytes = include_bytes!("./file.wasm");
let parser = Parser::new();
let module = parser.parse_module_bytes(bytes).unwrap();
let mudule = parser.parse_module_file("path/to/file.wasm").unwrap();
let module = parser.parse_module_stream(&mut stream).unwrap();
lib.rs:
有关文档,请参阅 tinywasm。
依赖关系
~3.5MB
~60K SLoC