draw

module std::websource

The browser's side of a web-wasm32 program, whose event loop is the browser's: the program sets up what the browser calls back, such as animation frames and input events, then lets main return while it keeps running. Externs a module declares come from the JavaScript beside it, <module>.web.js (section 6.3), as this module's do.

fn keep_runningsource

exp fn keep_running()

Lets main return to the browser with the program still running: the checks made when main returns (heap and resources left over) are skipped, and the browser calls back what the program gave it until the page closes. What the callbacks use must outlive main, on the heap or in statics. Only a browser has an event loop to return to: elsewhere this panics.