EventLoop

Trait EventLoop 

Source
pub trait EventLoop {
    type Window: Window;

    // Required method
    fn run<F>(self, handler: F) -> Result<(), PlatformError>
       where F: FnMut(Event, &Self::Window) -> ControlFlow + 'static;
}
Expand description

Event loop abstraction

Platform-specific event loops implement this trait to provide a unified interface for running Blinc applications.

Required Associated Types§

Source

type Window: Window

The window type for this event loop

Required Methods§

Source

fn run<F>(self, handler: F) -> Result<(), PlatformError>
where F: FnMut(Event, &Self::Window) -> ControlFlow + 'static,

Run the event loop

This method blocks until the application exits. The handler function is called for each event, and should return a ControlFlow to indicate whether to continue or exit.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§