guide: add String example usage to supported types

This commit is contained in:
Nick Fitzgerald
2018-08-13 16:20:25 -07:00
parent fa72afe286
commit 74dc8874e1
4 changed files with 52 additions and 0 deletions

View File

@ -73,6 +73,18 @@ Copies the string's contents back and forth between the JavaScript
garbage-collected heap and the Wasm linear memory with `TextDecoder` and
`TextEncoder`
### Example Rust Usage
```rust
{{#include ../../../examples/guide-supported-types-examples/src/string.rs}}
```
### Example JavaScript Usage
```js
{{#include ../../../examples/guide-supported-types-examples/string.js}}
```
## `char`
| `T` parameter | `&T` parameter | `&mut T` parameter | `T` return value | `Option<T>` parameter | `Option<T>` return value | JavaScript representation |