Cmd

Type Alias Cmd 

Source
pub type Cmd = Pin<Box<dyn Future<Output = Option<Msg>> + Send>>;
Expand description

A command represents an asynchronous operation that may produce a message.

Commands are typically created by the init and update methods of your Model and are then executed by the Program’s event loop.

The Cmd type is a Pin<Box<dyn Future<Output = Option<Msg>> + Send>>, which means it’s a boxed, pinned future that returns an Option<Msg>. If the command produces a message, it will be sent back to the Program to be processed by the update method.

Aliased Type§

pub struct Cmd { /* private fields */ }