Skip to main content

EventLoop

Trait EventLoop 

Source
pub trait EventLoop {
    type Close: Send + Sync + Debug + Display;
    type Err: Send + Sync + Error;

    // Required methods
    fn event_loop_join_handle(
        &self,
    ) -> &Arc<RwLock<JoinHandle<Result<Self::Close, Self::Err>>>>;
    fn is_closed(&self) -> bool;
    fn close<'life0, 'async_trait>(
        &'life0 self,
        reason: Self::Close,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn event_loop_join_handle( &self, ) -> &Arc<RwLock<JoinHandle<Result<Self::Close, Self::Err>>>>

Source

fn is_closed(&self) -> bool

Source

fn close<'life0, 'async_trait>( &'life0 self, reason: Self::Close, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

If Err is returned, the event loop is already closed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§