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>>,
) -> &UPDATES
pub fn update_op( &self, op: UpdateOp, target: impl Into<Option<WidgetId>>, ) -> &UPDATES
Schedules an UpdateOp
that optionally affects the target
widget.
sourcepub fn update_op_window(&self, op: UpdateOp, target: WindowId) -> &UPDATES
pub fn update_op_window(&self, op: UpdateOp, target: WindowId) -> &UPDATES
Schedules an UpdateOp
for the window only.
sourcepub fn update(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
pub fn update(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
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) -> &UPDATES
pub fn update_window(&self, target: WindowId) -> &UPDATES
Schedules an update for the window only.
sourcepub fn update_info(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
pub fn update_info(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
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) -> &UPDATES
pub fn update_info_window(&self, target: WindowId) -> &UPDATES
Schedules an info rebuild for the window only.
sourcepub fn layout(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
pub fn layout(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
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) -> &UPDATES
pub fn layout_window(&self, target: WindowId) -> &UPDATES
Schedules a layout update for the window only.
sourcepub fn render(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
pub fn render(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
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) -> &UPDATES
pub fn render_window(&self, target: WindowId) -> &UPDATES
Schedules a new frame for the window only.
sourcepub fn render_update(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
pub fn render_update(&self, target: impl Into<Option<WidgetId>>) -> &UPDATES
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) -> &UPDATES
pub fn render_update_window(&self, target: WindowId) -> &UPDATES
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>(&self, future: F) -> OnUpdateHandle
pub fn run<F>(&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>(&self, handler: H) -> OnUpdateHandlewhere
H: AppHandler<UpdateArgs>,
pub fn run_hn_once<H>(&self, handler: H) -> OnUpdateHandlewhere
H: AppHandler<UpdateArgs>,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> 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