A trait that abstracts a main loop mechanism that can be used on native targets as well as the wasm32-unknown-emscripten target.
The purpose of this is to get around the browser limitations that prevent you
from just naively looping, which would cause the browser tab to be frozen/killed.
Use this by implementing the trait on the data object that contains all data that should be available to the main loop
Use this function to initiate the looping.
Note that Emscripten only simulates looping - in reality the looping is done through scheduling. Due to this, to prevent code beyond the loop
scheduling to be run, it has to terminate the code flow. This means that in your web builds, the code after this run function will never be executed, even if the looping is terminated.
For more information, consult the Emscripten docs