Trait EventLoopExt

Source
pub trait EventLoopExt {
    type User;

    // Required method
    fn block_on<F, Fut>(self, handler: F, fut: Fut) -> !
       where F: FnMut(Event<'_, Self::User>, &Elwt<Signal<Self::User>>, &mut ControlFlow) + 'static,
             Fut: Future<Output = Infallible> + 'static;
}
Expand description

An extension trait for EventLoop that allows one to block on a future.

Required Associated Types§

Required Methods§

Source

fn block_on<F, Fut>(self, handler: F, fut: Fut) -> !
where F: FnMut(Event<'_, Self::User>, &Elwt<Signal<Self::User>>, &mut ControlFlow) + 'static, Fut: Future<Output = Infallible> + 'static,

Block on the provided future indefinitely.

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.

Implementations on Foreign Types§

Source§

impl<T: Send + 'static> EventLoopExt for EventLoop<Signal<T>>

Source§

type User = T

Source§

fn block_on<F, Fut>(self, handler: F, fut: Fut) -> !
where F: FnMut(Event<'_, Self::User>, &Elwt<Signal<Self::User>>, &mut ControlFlow) + 'static, Fut: Future<Output = Infallible> + 'static,

Implementors§