Skip to main content

Crate widgetkit_runtime

Crate widgetkit_runtime 

Source
Expand description

Lifecycle-driven runtime for WidgetKit. The current runtime scope is intentionally a single widget instance per app/host pair. All timers and background tasks belong to that widget instance and are shut down with it. Rendering is demand-driven and redraw requests are coalesced until the pending frame is consumed.

Redraw invalidation model:

  • request_render() marks the current frame dirty.
  • repeated render requests before the host consumes the pending frame are coalesced.
  • hosts should request redraws on demand instead of running a permanent render loop.
  • shutdown clears pending redraw state before dispose completes.
  • late messages, timer completions, task completions, and render requests are ignored once their widget instance token no longer matches the live instance.

Re-exports§

pub use widgetkit_core;

Structs§

AppRunner
Runtime runner for one widget instance lifetime. Timers and tasks are instance-owned and are shut down with stop/dispose.
DisposeCtx
MountCtx
RenderCtx
Scheduler
StartCtx
StopCtx
Tasks
UpdateCtx
WidgetApp
Application bootstrap for a single widget instance bound to one host and one renderer. The runtime is demand-driven and only redraws when widget code requests it.

Enums§

Event

Traits§

HostRunner
Widget