pub struct UPDATES;Expand description
Update schedule service.
Implementations§
Source§impl UPDATES
impl UPDATES
Sourcepub fn sender(&self) -> AppEventSender
pub fn sender(&self) -> AppEventSender
Create an AppEventSender that can be used to awake the app and send app events from threads outside of the app.
Sourcepub fn waker(&self, target: impl Into<Option<WidgetId>>) -> Waker
pub fn waker(&self, target: impl Into<Option<WidgetId>>) -> Waker
Create an std task waker that wakes the event loop and updates.
Sourcepub fn update_op(
&self,
op: UpdateOp,
target: impl Into<Option<WidgetId>>,
) -> &Self
pub fn update_op( &self, op: UpdateOp, target: impl Into<Option<WidgetId>>, ) -> &Self
Schedules an UpdateOp that optionally affects the target widget.
Sourcepub fn update_op_window(&self, op: UpdateOp, target: WindowId) -> &Self
pub fn update_op_window(&self, op: UpdateOp, target: WindowId) -> &Self
Schedules an UpdateOp for the window only.
Sourcepub fn update(&self, target: impl Into<Option<WidgetId>>) -> &Self
pub fn update(&self, target: impl Into<Option<WidgetId>>) -> &Self
Schedules an update that affects the target.
After the current update cycle ends a new update will happen that includes the target widget.
Sourcepub fn update_window(&self, target: WindowId) -> &Self
pub fn update_window(&self, target: WindowId) -> &Self
Schedules an update for the window only.
Sourcepub fn update_info(&self, target: impl Into<Option<WidgetId>>) -> &Self
pub fn update_info(&self, target: impl Into<Option<WidgetId>>) -> &Self
Schedules an info rebuild that affects the target.
After the current update cycle ends a new update will happen that requests an info rebuild that includes the target widget.
Sourcepub fn update_info_window(&self, target: WindowId) -> &Self
pub fn update_info_window(&self, target: WindowId) -> &Self
Schedules an info rebuild for the window only.
Sourcepub fn layout(&self, target: impl Into<Option<WidgetId>>) -> &Self
pub fn layout(&self, target: impl Into<Option<WidgetId>>) -> &Self
Schedules a layout update that affects the target.
After the current update cycle ends and there are no more updates requested a layout pass is issued that includes the target widget.
Sourcepub fn layout_window(&self, target: WindowId) -> &Self
pub fn layout_window(&self, target: WindowId) -> &Self
Schedules a layout update for the window only.
Sourcepub fn render(&self, target: impl Into<Option<WidgetId>>) -> &Self
pub fn render(&self, target: impl Into<Option<WidgetId>>) -> &Self
Schedules a full render that affects the target.
After the current update cycle ends and there are no more updates or layouts requested a render pass is issued that
includes the target widget.
If no target is provided only the app extensions receive a render request.
Sourcepub fn render_window(&self, target: WindowId) -> &Self
pub fn render_window(&self, target: WindowId) -> &Self
Schedules a new frame for the window only.
Sourcepub fn render_update(&self, target: impl Into<Option<WidgetId>>) -> &Self
pub fn render_update(&self, target: impl Into<Option<WidgetId>>) -> &Self
Schedules a render update that affects the target.
After the current update cycle ends and there are no more updates or layouts requested a render pass is issued that
includes the target widget marked for render update only. Note that if a full render was requested for another widget
on the same window this request is upgraded to a full frame render.
Sourcepub fn render_update_window(&self, target: WindowId) -> &Self
pub fn render_update_window(&self, target: WindowId) -> &Self
Schedules a render update for the window only.
Sourcepub fn is_pending_render(&self, window_id: WindowId) -> bool
pub fn is_pending_render(&self, window_id: WindowId) -> bool
Returns true is render or render update is requested for the window.
Sourcepub fn run<F: Future<Output = ()> + Send + 'static>(
&self,
future: impl IntoFuture<Output = (), IntoFuture = F>,
) -> OnUpdateHandle
pub fn run<F: Future<Output = ()> + Send + 'static>( &self, future: impl IntoFuture<Output = (), IntoFuture = F>, ) -> OnUpdateHandle
Schedule the future to run in the app context, in the preview track of the next update.
This requests an app update. Each future awake also requests an app update and also runs in the preview track.
Returns a handle that can be dropped to cancel execution.
Sourcepub fn run_hn_once(&self, handler: Handler<UpdateArgs>) -> OnUpdateHandle
pub fn run_hn_once(&self, handler: Handler<UpdateArgs>) -> OnUpdateHandle
Schedule a handler to run once in the app context, in the preview track of the next update.
The Handler can be any kind, including async handlers. If the handler is async and does not finish in
one call it is scheduled to update in preview updates.
Returns a handle that can be dropped to cancel execution.
Sourcepub fn on_pre_update(&self, handler: Handler<UpdateArgs>) -> OnUpdateHandle
pub fn on_pre_update(&self, handler: Handler<UpdateArgs>) -> OnUpdateHandle
Create a preview update handler.
The handler is called every time the app updates, just before the UI updates. It can be any of the non-async Handler,
use the hn! or hn_once! macros to declare the closure. You must avoid using async handlers because UI bound async
tasks cause app updates to awake, so it is very easy to lock the app in a constant sequence of updates. You can use run
to start an async app context task.
Returns an OnUpdateHandle that can be used to unsubscribe, you can also unsubscribe from inside the handler by calling
APP_HANDLER.unsubscribe.
Sourcepub fn on_update(&self, handler: Handler<UpdateArgs>) -> OnUpdateHandle
pub fn on_update(&self, handler: Handler<UpdateArgs>) -> OnUpdateHandle
Create an update handler.
The handler is called every time the app updates, just after the UI updates. It can be any of the non-async Handler,
use the hn! or hn_once! macros to declare the closure. You must avoid using async handlers because UI bound async
tasks cause app updates to awake, so it is very easy to lock the app in a constant sequence of updates. You can use run
to start an async app context task.
Returns an OnUpdateHandle that can be used to unsubscribe, you can also unsubscribe from inside the handler by calling
APP_HANDLER.unsubscribe.
Auto Trait Implementations§
impl Freeze for UPDATES
impl RefUnwindSafe for UPDATES
impl Send for UPDATES
impl Sync for UPDATES
impl Unpin for UPDATES
impl UnwindSafe for UPDATES
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more