Module application

Module application 

Source
Expand description

Create and run iced applications step by step.

§Example

use iced::widget::{button, column, text, Column};
use iced::Theme;

pub fn main() -> iced::Result {
    iced::application(u64::default, update, view)
        .theme(Theme::Dark)
        .centered()
        .run()
}

#[derive(Debug, Clone)]
enum Message {
    Increment,
}

fn update(value: &mut u64, message: Message) {
    match message {
        Message::Increment => *value += 1,
    }
}

fn view(value: &u64) -> Column<Message> {
    column![
        text(value),
        button("+").on_press(Message::Increment),
    ]
}

Re-exports§

pub use timed::timed;

Modules§

timed
An Application that receives an Instant in update logic.

Structs§

Application
The underlying definition and configuration of an iced application.

Traits§

BootFn
The logic to initialize the State of some Application.
IntoBoot
The initial state of some Application.
ThemeFn
The theme logic of some Application.
TitleFn
The title logic of some Application.
UpdateFn
The update logic of some Application.
ViewFn
The view logic of some Application.

Functions§

application
Creates an iced Application given its boot, update, and view logic.