Trait kludgine::app::Application

pub trait Application<AppMessage>: ApplicationSealed<AppMessage>
where AppMessage: Message,
{ // Required methods fn app(&self) -> App<AppMessage>; fn send( &mut self, message: AppMessage ) -> Option<<AppMessage as Message>::Response>; }
Expand description

A type that has a handle to the application thread.

Required Methods§

fn app(&self) -> App<AppMessage>

Returns a handle to the running application.

fn send( &mut self, message: AppMessage ) -> Option<<AppMessage as Message>::Response>

Sends an app message to the main event loop to be handled by the callback provided when the app was created.

This function will return None if the main event loop is no longer running. Otherwise, this function will block until the result of the callback has been received.

Implementors§

§

impl<AppMessage> Application<AppMessage> for App<AppMessage>
where AppMessage: Message,

§

impl<AppMessage> Application<AppMessage> for PendingApp<AppMessage>
where AppMessage: Message,

§

impl<AppMessage> Application<AppMessage> for RunningWindow<AppMessage>
where AppMessage: Message,