File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 52
52
- [ Imported JavaScript Types] ( ./reference/types/imported-js-types.md )
53
53
- [ Exported Rust Types] ( ./reference/types/exported-rust-types.md )
54
54
- [ ` 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 )
56
56
- [ ` *const T ` and ` *mut T ` ] ( ./reference/types/pointers.md )
57
57
- [ Numbers] ( ./reference/types/numbers.md )
58
58
- [ ` bool ` ] ( ./reference/types/bool.md )
Original file line number Diff line number Diff line change 1
- # ` Box<[JsValue] > `
1
+ # ` Box<[T]> ` and ` Vec<T >`
2
2
3
3
| ` T ` parameter | ` &T ` parameter | ` &mut T ` parameter | ` T ` return value | ` Option<T> ` parameter | ` Option<T> ` return value | JavaScript representation |
4
4
| :---:| :---:| :---:| :---:| :---:| :---:| :---:|
5
5
| Yes | No | No | Yes | Yes | Yes | A JavaScript ` Array ` object |
6
6
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.
8
17
9
18
## Example Rust Usage
10
19
You can’t perform that action at this time.
0 commit comments