Files
wasmtime/docs/examples-rust-memory.md
Alex Crichton e245e6dd9c Add examples of linking and WASI (#1369)
* Add examples of linking and WASI

This commit adds two example programs, one for linking two modules
together and one for instantiating WASI. The linkage example
additionally uses WASI to get some meaningful output at this time.

cc #1272

* Add examples to the book as well

* More links!

* Ignore examples from rustdoc testsing

* More example updates

* More ignored
2020-03-20 18:10:53 -05:00

25 lines
576 B
Markdown

# Using linear memory
You can also [browse this source code online][code] and clone the wasmtime
repository to run the example locally.
[code]: https://github.com/bytecodealliance/wasmtime/blob/master/examples/memory.rs
This example shows off how to interact with wasm memory in a module. Be sure to
read the documentation for [`Memory`] as well.
[`Memory`]: https://bytecodealliance.github.io/wasmtime/api/wasmtime/struct.Memory.html
## `memory.wat`
```wat
{{#include ../examples/memory.wat}}
```
## `memory.rs`
```rust,ignore
{{#include ../examples/memory.rs}}
```