https://github.com/thorstenhans/rust-lib-wasm
https://github.com/thorstenhans/rust-lib-wasm
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/thorstenhans/rust-lib-wasm
- Owner: ThorstenHans
- Created: 2021-11-01T18:03:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-01T18:04:37.000Z (over 4 years ago)
- Last Synced: 2025-02-15T10:17:35.783Z (over 1 year ago)
- Language: Rust
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust to WASM sample
This repository contains a simple Rust library which exposes the `multiply` function. You can build the library for `wasm32-wasi` using `cargo build --target wasm32-wasi`
## Invoke the multiply function
You can invoke the `multiply` function `wasmtime`:
```bash
# run WASM module via wasmtime
wasmtime --invoke multiply ./target/wasm32-wasi/debug/sample.wasm 3 3 4
# will print 36
```