EventLoopRunReturnExt

Trait EventLoopRunReturnExt 

Source
pub trait EventLoopRunReturnExt {
    type User;

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

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

Required Associated Types§

Required Methods§

Source

fn block_on_return<F, Fut>( &mut self, handler: F, fut: Fut, ) -> BlockOnReturnResult<Fut::Output>
where F: FnMut(Event<'_, Self::User>, &Elwt<Signal<Self::User>>, &mut ControlFlow), Fut: Future,

Block on the provided future until either the loop exits or the future returns a value.

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> EventLoopRunReturnExt for EventLoop<Signal<T>>

Source§

type User = T

Source§

fn block_on_return<F, Fut>( &mut self, handler: F, fut: Fut, ) -> BlockOnReturnResult<Fut::Output>
where F: FnMut(Event<'_, Self::User>, &Elwt<Signal<Self::User>>, &mut ControlFlow), Fut: Future,

Implementors§