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: F,
) -> OnUpdateHandle
pub fn run<F: Future<Output = ()> + Send + 'static>( &self, future: F, ) -> OnUpdateHandle
Schedule the future
to run in the app context, each future awake work runs as a preview update.
Returns a handle that can be dropped to cancel execution.
sourcepub fn run_hn_once<H: AppHandler<UpdateArgs>>(
&self,
handler: H,
) -> OnUpdateHandle
pub fn run_hn_once<H: AppHandler<UpdateArgs>>( &self, handler: H, ) -> OnUpdateHandle
Schedule an once handler to run when these updates are applied.
The callback is any of the once AppHandler
, including async handlers. If the handler is async and does not finish in
one call it is scheduled to update in preview updates.
sourcepub fn on_pre_update<H>(&self, handler: H) -> OnUpdateHandlewhere
H: AppHandler<UpdateArgs>,
pub fn on_pre_update<H>(&self, handler: H) -> OnUpdateHandlewhere
H: AppHandler<UpdateArgs>,
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 AppHandler
,
use the app_hn!
or app_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
unsubscribe
in the third parameter of app_hn!
or async_app_hn!
.
sourcepub fn on_update<H>(&self, handler: H) -> OnUpdateHandlewhere
H: AppHandler<UpdateArgs>,
pub fn on_update<H>(&self, handler: H) -> OnUpdateHandlewhere
H: AppHandler<UpdateArgs>,
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 AppHandler
,
use the app_hn!
or app_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
unsubscribe
in the third parameter of app_hn!
or async_app_hn!
.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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