Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename main -> start on wasm-bindgen(start) example #3648

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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