Trait iced::program::Update

source ·
pub trait Update<State, Message> {
    // Required method
    fn update(
        &self,
        state: &mut State,
        message: Message
    ) -> impl Into<Command<Message>>;
}
Expand description

The update logic of some Program.

This trait allows the program builder to take any closure that returns any Into<Command<Message>>.

Required Methods§

source

fn update( &self, state: &mut State, message: Message ) -> impl Into<Command<Message>>

Processes the message and updates the state of the Program.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, State, Message, C> Update<State, Message> for T
where T: Fn(&mut State, Message) -> C, C: Into<Command<Message>>,