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§
Required Methods§
Sourcefn run<F>(self, handler: F) -> Result<(), PlatformError>
fn run<F>(self, handler: F) -> Result<(), PlatformError>
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.