File tree 1 file changed +4
-4
lines changed
guide/src/reference/attributes/on-rust-exports
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
# ` start `
2
2
3
- When attached to a ` pub ` function this attribute will configure the ` start `
3
+ When attached to a function this attribute will configure the ` start `
4
4
section of the wasm executable to be emitted, executing the tagged function as
5
5
soon as the wasm module is instantiated.
6
6
7
7
``` rust
8
8
#[wasm_bindgen(start)]
9
- fn main () {
9
+ fn start () {
10
10
// executed automatically ...
11
11
}
12
12
```
13
13
14
14
The ` start ` section of the wasm executable will be configured to execute the
15
- ` main ` function here as soon as it can. Note that due to various practical
15
+ ` start ` function here as soon as it can. Note that due to various practical
16
16
limitations today the start section of the executable may not literally point to
17
- ` main ` , but the ` main ` function here should be started up automatically when the
17
+ ` start ` , but the ` start ` function here should be started up automatically when the
18
18
wasm module is loaded.
19
19
20
20
There's a few caveats to be aware of when using the ` start ` attribute:
You can’t perform that action at this time.
0 commit comments