pub struct Runtime<S: Spec, A: App<Spec = S>> { /* private fields */ }Expand description
The tick loop around the kernel. S is the app’s vocabulary, A the
app itself.
Implementations§
Source§impl<S: Spec, A: App<Spec = S>> Runtime<S, A>
impl<S: Spec, A: App<Spec = S>> Runtime<S, A>
Sourcepub fn new(app: A, cfg: RuntimeConfig, waker: Waker) -> (Self, Handle<S>)
pub fn new(app: A, cfg: RuntimeConfig, waker: Waker) -> (Self, Handle<S>)
Build the runtime and the app’s handle (design §2.5). The app’s
App::init runs once, before the first tick; its commands and
the config’s startup windows land in the first tick’s drain.
Sourcepub fn push_input(&mut self, input: InputEnvelope)
pub fn push_input(&mut self, input: InputEnvelope)
Feed one host input event; the next tick routes it.
Sourcepub fn tick(&mut self, now: Seconds) -> TickOutput
pub fn tick(&mut self, now: Seconds) -> TickOutput
One tick (design §2.5): drain the inbox, phases 1-4 and 7, deliver
the intents (their commands feed the settle passes), then zero-input
settle passes until quiet, at most MAX_SETTLE.
Sourcepub fn paint(&mut self, req: &FrameRequest, ctx: &mut dyn RenderContext)
pub fn paint(&mut self, req: &FrameRequest, ctx: &mut dyn RenderContext)
Paint one due frame request (phases 5-6 for its window). The commands the hooks declare apply from the next tick’s drain.
Sourcepub fn take_paint_wants_tick(&mut self) -> bool
pub fn take_paint_wants_tick(&mut self) -> bool
A paint since the last call asked for more work (a hook’s
request_frame, declared commands, clicks to deliver). The tick’s
wake predates the paint, so hosts check this after painting and
tick again instead of going idle.
Sourcepub fn snapshot(&self) -> Arc<VisualSnapshot<S>> ⓘ
pub fn snapshot(&self) -> Arc<VisualSnapshot<S>> ⓘ
The last published snapshot (same read as the handle’s).
Sourcepub fn a11y_tree(&self, win: WindowId) -> A11yTree
pub fn a11y_tree(&self, win: WindowId) -> A11yTree
The accessibility tree of win’s last composed frame (empty before one).
Sourcepub fn widget_snapshot(&self, win: WindowId) -> Vec<WidgetInfo>
pub fn widget_snapshot(&self, win: WindowId) -> Vec<WidgetInfo>
Every widget registered in win’s last composed frame.
Sourcepub fn should_exit(&self) -> bool
pub fn should_exit(&self) -> bool
The host should exit its loop (every window closed or Shutdown).