Skip to main content

EventLoopExt

Trait EventLoopExt 

Source
pub trait EventLoopExt<A: Application> {
    // Required methods
    fn send_user(
        &self,
        u: A::UserEvent,
    ) -> Result<(), EventLoopClosed<AppEvent<A>>>;
    fn ping_user_input(&self) -> Result<(), EventLoopClosed<AppEvent<A>>>;
    fn run_idle<F: FnOnce(&mut A, Args<'_, A>) + Send + Sync + 'static>(
        &self,
        f: F,
    ) -> Result<(), EventLoopClosed<AppEvent<A>>>;
}
Expand description

Helper trait to extend winit::EventLoopProxy with useful functions.

Required Methods§

Source

fn send_user(&self, u: A::UserEvent) -> Result<(), EventLoopClosed<AppEvent<A>>>

Sends a AppEvent::User event.

Source

fn ping_user_input(&self) -> Result<(), EventLoopClosed<AppEvent<A>>>

Sends a AppEvent::PingUserInput event.

Source

fn run_idle<F: FnOnce(&mut A, Args<'_, A>) + Send + Sync + 'static>( &self, f: F, ) -> Result<(), EventLoopClosed<AppEvent<A>>>

Sends a AppEvent::RunIdle event.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<A: Application> EventLoopExt<A> for EventLoopProxy<AppEvent<A>>

Implementors§