stuff
This commit is contained in:
@@ -57,6 +57,13 @@ widget_trait! {
|
||||
|
||||
pub trait HasTasks: Sized + HasState + HasEvents {
|
||||
fn tasks_mut(&mut self) -> &mut Tasks<Self>;
|
||||
|
||||
fn spawn_task<F: AsyncFnOnce(TaskCtx<Self>) + 'static + std::marker::Send>(&mut self, task: F)
|
||||
where
|
||||
F::CallOnceFuture: Send,
|
||||
{
|
||||
self.tasks_mut().spawn(task);
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AsyncWidgetEventFn<Rsc: HasEvents, W: ?Sized>:
|
||||
|
||||
Reference in New Issue
Block a user