Function new_event_loop

Source
pub fn new_event_loop() -> Result<EventLoop<()>, EventLoopError>
Expand description

Constructs the framework’s unit-user-event loop on the calling thread.

Platform main-thread requirements are preserved; use new_event_loop_allow_any_thread for worker-thread Linux tests.

§Errors

Returns winit’s construction error, including attempts to create more than one event loop where the platform forbids it.

§Examples

let loop_: winit::event_loop::EventLoop<()> =
    ailloli_ui_winit::new_event_loop().unwrap();