Skip to content

Commit

Permalink
Add note about safety in documentation
Browse files Browse the repository at this point in the history
Co-Authored-By: Michael Schmidt <[email protected]>
  • Loading branch information
daxpedda and RunDevelopment committed Dec 6, 2024
1 parent 3af8194 commit 34818be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions guide/src/reference/types/boxed-number-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
from the Wasm linear memory when returning a boxed slice to JavaScript, and vice
versa when receiving a JavaScript `TypedArray` as a boxed slice in Rust.

> **Note:** Numeric `MaybeUninit<T>` can always be assumed to be initialized
> upon transmission from Rust to JS and vice-versa. However, uninitialized
> values coming from Rust might contain unspecified values.
## Example Rust Usage

```rust
Expand Down
4 changes: 4 additions & 0 deletions guide/src/reference/types/number-slices.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| No | Yes | Yes | No | No | No | A JavaScript `TypedArray` view of the Wasm memory for the boxed slice of the appropriate type (`Int32Array`, `Uint8Array`, etc) |

> **Note:** Numeric `MaybeUninit<T>` can always be assumed to be initialized
> upon transmission from Rust to JS and vice-versa. However, uninitialized
> values coming from Rust might contain unspecified values.
## Example Rust Usage

```rust
Expand Down

0 comments on commit 34818be

Please sign in to comment.