wasmprinter

Crates.iowasmprinter
lib.rswasmprinter
version0.207.0
sourcesrc
created_at2019-11-18 17:42:38.354072
updated_at2024-05-07 22:54:48.590824
descriptionRust converter from the WebAssembly binary format to the text format.
homepagehttps://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmprinter
repositoryhttps://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmprinter
max_upload_size
id182250
size191,008
wasmtime-publish (github:bytecodealliance:wasmtime-publish)

documentation

https://docs.rs/wasmprinter

README

wasmprinter

A Bytecode Alliance project

A Rust parser for printing a WebAssembly binary in the WebAssembly Text Format (WAT).

Crates.io version Download docs.rs docs

Usage

Add wasmprinter to your Cargo.toml

$ cargo add wasmprinter

You can then convert wasm binaries to strings like so:

fn main() -> Result<()> {
    let foo_wat = wasmprinter::print_file("path/to/foo.wasm")?;

    let binary = /* ... */;
    let wat = wasmprinter::print_bytes(&binary)?;

    // ...
}

License

This project is licensed under the Apache 2.0 license with the LLVM exception. See LICENSE for more details.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Commit count: 2518

cargo fmt