Skip to content

Commit

Permalink
rename main -> start on wasm-bindgen(start) example (#3648)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuk committed Oct 11, 2023
1 parent 4e60952 commit bfe644f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guide/src/reference/attributes/on-rust-exports/start.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# `start`

When attached to a `pub` function this attribute will configure the `start`
When attached to a function this attribute will configure the `start`
section of the wasm executable to be emitted, executing the tagged function as
soon as the wasm module is instantiated.

```rust
#[wasm_bindgen(start)]
fn main() {
fn start() {
// executed automatically ...
}
```

The `start` section of the wasm executable will be configured to execute the
`main` function here as soon as it can. Note that due to various practical
`start` function here as soon as it can. Note that due to various practical
limitations today the start section of the executable may not literally point to
`main`, but the `main` function here should be started up automatically when the
`start`, but the `start` function here should be started up automatically when the
wasm module is loaded.

There's a few caveats to be aware of when using the `start` attribute:
Expand Down

0 comments on commit bfe644f

Please sign in to comment.