pub trait AsyncComponentUpdate<ParentModel: Model>: Model {
    fn init_model(parent_model: &ParentModel) -> Self;
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        msg: Self::Msg,
        components: &'life1 Self::Components,
        sender: Sender<Self::Msg>,
        parent_sender: Sender<ParentModel::Msg>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; }
Available on crate feature tokio-rt only.
Expand description

ComponentUpdate for asynchronous workers and components.

Required Methods§

Initialize the model of the component or worker.

In case you want to share information or settings with the parent component you get the parent’s model passed as parameter.

Update the model. The parent_sender allows to send messages to the parent.