Skip to main content

Module run

Module run 

Source
Expand description

The winit event loop, WindowConfig, and the run_windowed/run_app drivers. The winit event loop and the windowed app drivers.

run_windowed drives a raw FnMut(&mut Terminal<..>) closure; run_app drives an App. This is the inverted driver: winit owns the loop and calls back into the app on each redraw, so it cannot be core’s generic run_blocking, which owns its own while loop.

Structs§

EventProxy
A thread-safe handle for injecting application-defined events into a running windowed event loop from another thread (network, audio, timer, …).
EventProxyClosed
Error returned by EventProxy::send_event when the event loop it targets has already exited.
WindowConfig
Window configuration for run_windowed / run_app.

Functions§

run_app
Drive an App from the windowed event loop.
run_app_with_proxy
Same as run_app, but also hands on_proxy an EventProxy for injecting cross-thread events.
run_app_with_typed_proxy
Same as run_app_with_proxy, but the injected payload can be any T: Send + 'static instead of a fixed u64.
run_windowed
Open a window and drive app_loop from the winit event loop.
run_windowed_with_proxy
Same as run_windowed, but also hands on_proxy an EventProxy for injecting cross-thread events.
run_windowed_with_typed_proxy
Same as run_windowed_with_proxy, but the injected payload can be any T: Send + 'static instead of a fixed u64.