Skip to content

Commit 68f2d8f

Browse files
committed
Update the guide
1 parent efc958e commit 68f2d8f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

guide/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
- [Imported JavaScript Types](./reference/types/imported-js-types.md)
5353
- [Exported Rust Types](./reference/types/exported-rust-types.md)
5454
- [`JsValue`](./reference/types/jsvalue.md)
55-
- [`Box<[JsValue]>`](./reference/types/boxed-jsvalue-slice.md)
55+
- [`Box<[T]>` and `Vec<T>`](./reference/types/boxed-slices.md)
5656
- [`*const T` and `*mut T`](./reference/types/pointers.md)
5757
- [Numbers](./reference/types/numbers.md)
5858
- [`bool`](./reference/types/bool.md)

guide/src/reference/types/boxed-jsvalue-slice.md renamed to guide/src/reference/types/boxed-slices.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
# `Box<[JsValue]>`
1+
# `Box<[T]>` and `Vec<T>`
22

33
| `T` parameter | `&T` parameter | `&mut T` parameter | `T` return value | `Option<T>` parameter | `Option<T>` return value | JavaScript representation |
44
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
55
| Yes | No | No | Yes | Yes | Yes | A JavaScript `Array` object |
66

7-
Boxed slices of imported JS types and exported Rust types are also supported. `Vec<T>` is supported wherever `Box<[T]>` is.
7+
You can pass boxed slices and `Vec`s of several different types to and from JS:
8+
9+
- `JsValue`s.
10+
- Imported JavaScript types.
11+
- Exported Rust types.
12+
- `String`s.
13+
14+
[You can also pass boxed slices of numbers to JS](boxed-number-slices.html),
15+
except that they're converted to typed arrays (`Uint8Array`, `Int32Array`, etc.)
16+
instead of regular arrays.
817

918
## Example Rust Usage
1019

0 commit comments

Comments
 (0)