Trait zng_app::widget::UiTaskWidget
source · pub trait UiTaskWidget<R> {
// Required method
fn new<F>(
target: Option<WidgetId>,
task: impl IntoFuture<IntoFuture = F>,
) -> Self
where F: Future<Output = R> + Send + 'static;
}
Expand description
Integrate UiTask
with widget updates.
Required Methods§
sourcefn new<F>(
target: Option<WidgetId>,
task: impl IntoFuture<IntoFuture = F>,
) -> Self
fn new<F>( target: Option<WidgetId>, task: impl IntoFuture<IntoFuture = F>, ) -> Self
Create a UI bound future executor.
The task
is inert and must be polled using update
to start, and it must be polled every
UiNode::update
after that, in widgets the target
can be set so that the update requests are received.
Object Safety§
This trait is not object safe.