cosmic::iced_winit::runtime::programTrait Program
source pub trait Program: Sized {
type Renderer: Renderer;
type Theme;
type Message: Debug + Send;
// Required methods
fn update(&mut self, message: Self::Message) -> Task<Self::Message>;
fn view(&self) -> Element<'_, Self::Message, Self::Theme, Self::Renderer>;
}
Expand description
The core of a user interface application following The Elm Architecture.
The graphics backend to use to draw the Program
.
The theme used to draw the Program
.
The type of messages your Program
will produce.
Handles a message and updates the state of the Program
.
This is where you define your update logic. All the messages,
produced by either user interactions or commands, will be handled by
this method.
Any Task
returned will be executed immediately in the
background by shells.
Returns the widgets to display in the Program
.
These widgets can produce messages based on user interaction.