Crates.io | tinywasm-parser |
lib.rs | tinywasm-parser |
version | 0.8.0 |
source | src |
created_at | 2023-12-09 14:10:42.77741 |
updated_at | 2024-08-29 13:24:03.255595 |
description | TinyWasm parser |
homepage | |
repository | https://github.com/explodingcamera/tinywasm |
max_upload_size | |
id | 1063700 |
size | 59,186 |
tinywasm-parser
This crate provides a parser that can parse WebAssembly modules into a TinyWasm module.
It uses my fork of the wasmparser
crate that has been modified to be compatible with no_std
environments.
std
: Enables the use of std
and std::io
for parsing from files and streams.logging
: Enables logging of the parsing process using the log
crate.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();