pub trait UiTaskWidget<R> {
// Required methods
fn new<F>(
target: Option<WidgetId>,
task: impl IntoFuture<IntoFuture = F>,
) -> Self
where F: Future<Output = R> + Send + 'static;
fn new_boxed(
target: Option<WidgetId>,
task: Pin<Box<dyn Future<Output = R> + Send + 'static>>,
) -> Self;
}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.