Function run_winit_host

Source
pub fn run_winit_host<A: 'static, D: HostDriver<A>>(
    host: &mut WinitHost<A, D>,
) -> Result<(), EventLoopError>
Expand description

Creates a native event loop and runs a WinitHost in wait mode.

The loop may be created on a worker thread on Linux. Before entering it, one shared wake-only proxy is installed into every attached host subsystem. The call blocks until exit.

§Errors

Propagates event-loop construction and non-normalized run failures.

§Examples

use ailloli_ui_winit::{run_winit_host, NoopHostDriver, UiApp, WinitHost};
let mut host = WinitHost::new(UiApp::<()>::new(), NoopHostDriver);
run_winit_host(&mut host)?;