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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.