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§

source

fn new<F>( target: Option<WidgetId>, task: impl IntoFuture<IntoFuture = F>, ) -> Self
where F: Future<Output = R> + Send + 'static,

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.

Implementations on Foreign Types§

source§

impl<R> UiTaskWidget<R> for UiTask<R>

source§

fn new<F>( target: Option<WidgetId>, task: impl IntoFuture<IntoFuture = F>, ) -> Self
where F: Future<Output = R> + Send + 'static,

Implementors§