Struct relm4::AsyncRelmWorker
source · pub struct AsyncRelmWorker<Model, ParentModel>where
Model: AsyncComponentUpdate<ParentModel, Widgets = ()> + Send + 'static,
Model::Components: Send,
ParentModel: ModelTrait,
ParentModel::Msg: Send,
Model::Msg: Send,{ /* private fields */ }
Available on crate feature
tokio-rt
only.Expand description
A AsyncRelmWorker
is like a RelmWorker
but runs the AsyncComponentUpdate::update
function in
a tokio Runtime
.
Implementations§
source§impl<Model, ParentModel> AsyncRelmWorker<Model, ParentModel>where
Model: AsyncComponentUpdate<ParentModel, Widgets = ()> + Send,
Model::Components: Send,
ParentModel: ModelTrait,
ParentModel::Msg: Send,
Model::Msg: Send,
impl<Model, ParentModel> AsyncRelmWorker<Model, ParentModel>where Model: AsyncComponentUpdate<ParentModel, Widgets = ()> + Send, Model::Components: Send, ParentModel: ModelTrait, ParentModel::Msg: Send, Model::Msg: Send,
sourcepub fn with_new_tokio_rt(
parent_model: &ParentModel,
parent_sender: Sender<ParentModel::Msg>
) -> Self
pub fn with_new_tokio_rt( parent_model: &ParentModel, parent_sender: Sender<ParentModel::Msg> ) -> Self
Create a new AsyncRelmWorker
that runs the AsyncComponentUpdate::update
function in
a tokio Runtime
.
Trait Implementations§
source§impl<Model, ParentModel> Clone for AsyncRelmWorker<Model, ParentModel>where
Model: AsyncComponentUpdate<ParentModel, Widgets = ()> + Send + 'static + Clone,
Model::Components: Send,
ParentModel: ModelTrait + Clone,
ParentModel::Msg: Send,
Model::Msg: Send + Clone,
impl<Model, ParentModel> Clone for AsyncRelmWorker<Model, ParentModel>where Model: AsyncComponentUpdate<ParentModel, Widgets = ()> + Send + 'static + Clone, Model::Components: Send, ParentModel: ModelTrait + Clone, ParentModel::Msg: Send, Model::Msg: Send + Clone,
source§fn clone(&self) -> AsyncRelmWorker<Model, ParentModel>
fn clone(&self) -> AsyncRelmWorker<Model, ParentModel>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more