* Tweak the API of the `Val` type
A few updates to the API of the `Val` type:
* Added a payload for `V128`.
* Replace existing accessor methods with `Option`-returning versions.
* Add `unwrap_xxx` family of methods to extract a value and panic.
* Remove `Into` conversions which panic, since panicking in `From` or
`Into` isn't idiomatic in Rust
* Add documentation to all methods/values/enums/etc.
* Rename `Val::default` to `Val::null`
* Run rustfmt
* Review comments
Several of the examples wrap the Instance in a HostRef, only to
immediately borrow it again to get the exports,and then never touch it
again. Simplify this by owning the Instance directly.
* Rename the `wasmtime_api` library to match the containing `wasmtime` crate
Commit d9ca508f80 renamed the
`wasmtime-api` crate to `wasmtime`, but left the name of the library it
contains as `wasmtime_api`.
It's fairly unusual for a crate to contain a library with a different
name, and it results in rather confusing error messages for a user; if
you list `wasmtime = "0.7"` in `Cargo.toml`, you can't `use
wasmtime::*`, you have to `use wasmtime_api::*;`.
Rename the `wasmtime_api` library to `wasmtime`.
* Stop renaming wasmtime to api on imports
Various users renamed the crate formerly known as wasmtime_api to api,
and then used api:: prefixes everywhere; change those all to wasmtime::
and drop the renaming.
* Tidy up the `hello` example for `wasmtime`
* Remove the `*.wat` and `*.wasm` files and instead just inline the
`*.wat` into the example.
* Touch up comments so they're not just a repeat of the `println!`
below.
* Move `*.wat` for `memory` example inline
No need to handle auxiliary files with the ability to parse it inline!
* Move `multi.wasm` inline into `multi.rs` example
* Move `*.wasm` for gcd example inline
* Move `*.wat` inline with `import_calling_export` test
* Remove checked in `lightbeam/test.wasm`
Instead move the `*.wat` into the source and parse it into wasm there.
* Run rustfmt