Trait appit::Application

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

A type that has a handle to the application thread.

Required Methods§

source

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

Returns a handle to the running application.

source

fn send(&mut self, message: AppMessage) -> Option<AppMessage::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§

source§

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

source§

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

source§

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