Files
wasmtime/examples
Ryan Brewster 2145855954 Add example of execution limits using fuel consumption (#2869)
* Add example of execution limits using fuel consumption

* run rustfmt

* Use a more naive WAT implementation

* Catch error and return cleanly

* Add a C example to demonstrate fuel consumption

* Add error handling for add_fuel
2021-05-04 10:39:01 -05:00
..
2021-03-26 15:37:57 -07:00
2021-03-26 15:37:57 -07:00

Examples of the wasmtime API

This directory contains a number of examples of using the wasmtime API from different languages. Currently examples are all in Rust and C using the wasmtime crate or the wasmtime embedding API.

Each example is available in both C and in Rust. Examples are accompanied with a *.wat file which is the wasm input, or a Rust project in a wasm folder which is the source code for the original wasm file.

Rust examples can be executed with cargo run --example $name, and C examples need to be compiled using your system compiler and appropriate header files.

For more information see the examples themselves!