Trait Update

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

The update logic of some timed Application.

This is like application::Update, but it also takes an Instant.

Required Methods§

Source

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

Processes the message and updates the state of the Application.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<State, Message> Update<State, Message> for ()

Source§

fn update( &self, _state: &mut State, _message: Message, _now: Instant, ) -> impl Into<Task<Message>>

Implementors§

Source§

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