examples: adds rust build and WASI example (#676)

This fixes where our pull requests didn't check the rust source in
examples were valid. It also adds an example of wasi with rust.

This uses cargo-wasi because the default target creates almost 2MB of
wasm for a simple cat program.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-07-08 10:49:50 +08:00
committed by GitHub
parent 66d43a2a52
commit f0e05fb95b
11 changed files with 123 additions and 28 deletions

View File

@@ -6,6 +6,8 @@ edition = "2021"
[lib]
# cdylib builds a a %.wasm file with `cargo build --release --target wasm32-unknown-unknown`
crate-type = ["cdylib"]
name = "greet"
path = "greet.rs"
[dependencies]
# wee_aloc is a WebAssembly optimized allocator, which is needed to use non-numeric types like strings.