Skip to main content

AccessWinitActiveEventLoop

Trait AccessWinitActiveEventLoop 

Source
pub trait AccessWinitActiveEventLoop {
    // Required method
    async fn run_with_active_event_loop<F, T>(&self, f: F) -> T
       where F: FnOnce(&dyn ActiveEventLoop) -> T + 'static,
             T: 'static;
}
Expand description

Trait to access winit::event_loop::ActiveEventLoop.

In fact, the active event loop is not available all the time, so accessing the active event loop will require the window subsystem to put them in correct timing. Thus the accessor must be asynchronous.

Required Methods§

Source

async fn run_with_active_event_loop<F, T>(&self, f: F) -> T
where F: FnOnce(&dyn ActiveEventLoop) -> T + 'static, T: 'static,

Run the function in the place where the active event loop is available.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§