Trait iced_native::program::Program[][src]

pub trait Program: Sized {
    type Renderer: Renderer;
    type Message: Debug + Send;
    type Clipboard: Clipboard;
    fn update(
        &mut self,
        message: Self::Message,
        clipboard: &mut Self::Clipboard
    ) -> Command<Self::Message>;
fn view(&mut self) -> Element<'_, Self::Message, Self::Renderer>; }

The core of a user interface application following The Elm Architecture.

Associated Types

type Renderer: Renderer[src]

The graphics backend to use to draw the Program.

type Message: Debug + Send[src]

The type of messages your Program will produce.

type Clipboard: Clipboard[src]

The type of Clipboard your Program will use.

Loading content...

Required methods

fn update(
    &mut self,
    message: Self::Message,
    clipboard: &mut Self::Clipboard
) -> Command<Self::Message>
[src]

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 Command returned will be executed immediately in the background by shells.

fn view(&mut self) -> Element<'_, Self::Message, Self::Renderer>[src]

Returns the widgets to display in the Program.

These widgets can produce messages based on user interaction.

Loading content...

Implementors

Loading content...