mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-28 12:11:34 +00:00
Fix very small typo in guide (#575)
This commit is contained in:
committed by
Alex Crichton
parent
decdbd92b8
commit
fa4b636c25
@ -135,7 +135,7 @@ same as [`RefCell`] and can be mostly glossed over.
|
|||||||
|
|
||||||
The purpose for this type, if you're interested though, is to uphold Rust's
|
The purpose for this type, if you're interested though, is to uphold Rust's
|
||||||
guarantees about aliasing in a world where aliasing is rampant (JS).
|
guarantees about aliasing in a world where aliasing is rampant (JS).
|
||||||
Specifically the `&Foo` type means that there can be as much alaising as you'd
|
Specifically the `&Foo` type means that there can be as much aliasing as you'd
|
||||||
like, but crucially `&mut Foo` means that it is the sole pointer to the data
|
like, but crucially `&mut Foo` means that it is the sole pointer to the data
|
||||||
(no other `&Foo` to the same instance exists). The [`RefCell`] type in libstd
|
(no other `&Foo` to the same instance exists). The [`RefCell`] type in libstd
|
||||||
is a way of dynamically enforcing this at runtime (as opposed to compile time
|
is a way of dynamically enforcing this at runtime (as opposed to compile time
|
||||||
|
@ -197,5 +197,5 @@ possibilities!
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
All of these functions will call `console.log` in Rust, but each identifier
|
All of these functions will call `console.log` in JS, but each identifier
|
||||||
will have only one signature in Rust.
|
will have only one signature in Rust.
|
||||||
|
@ -5,7 +5,7 @@ values enter Rust. Here we'll go into some more depth about how this is
|
|||||||
implemented. There are two categories of traits for converting values, traits
|
implemented. There are two categories of traits for converting values, traits
|
||||||
for converting values from Rust to JS and traits for the other way around.
|
for converting values from Rust to JS and traits for the other way around.
|
||||||
|
|
||||||
### From Rust to JS
|
## From Rust to JS
|
||||||
|
|
||||||
First up let's take a look at going from Rust to JS:
|
First up let's take a look at going from Rust to JS:
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ The `IntoWasmAbi` trait is used in two locations. First it's used to convert
|
|||||||
return values of Rust exported functions to JS. Second it's used to convert the
|
return values of Rust exported functions to JS. Second it's used to convert the
|
||||||
Rust arguments of JS functions imported to Rust.
|
Rust arguments of JS functions imported to Rust.
|
||||||
|
|
||||||
### From JS to Rust
|
## From JS to Rust
|
||||||
|
|
||||||
Unfortunately the opposite direction from above, going from JS to Rust, is a bit
|
Unfortunately the opposite direction from above, going from JS to Rust, is a bit
|
||||||
more complicated. Here we've got three traits:
|
more complicated. Here we've got three traits:
|
||||||
@ -81,7 +81,7 @@ The `From*` family of traits are used for converting the Rust arguments in Rust
|
|||||||
exported functions to JS. They are also used for the return value in JS
|
exported functions to JS. They are also used for the return value in JS
|
||||||
functions imported into Rust.
|
functions imported into Rust.
|
||||||
|
|
||||||
### Global stack
|
## Global stack
|
||||||
|
|
||||||
Mentioned above not all Rust types will fit within 32 bits. While we can
|
Mentioned above not all Rust types will fit within 32 bits. While we can
|
||||||
communicate an `f64` we don't necessarily have the ability to use all the bits.
|
communicate an `f64` we don't necessarily have the ability to use all the bits.
|
||||||
|
Reference in New Issue
Block a user