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 snapshot(&self) -> Arc<VisualSnapshot<S>> ⓘ
pub fn snapshot(&self) -> Arc<VisualSnapshot<S>> ⓘ
The last published snapshot (same read as the handle’s).
Sourcepub fn should_exit(&self) -> bool
pub fn should_exit(&self) -> bool
The host should exit its loop (every window closed or Shutdown).
Auto Trait Implementations§
impl<S, A> !RefUnwindSafe for Runtime<S, A>
impl<S, A> !Sync for Runtime<S, A>
impl<S, A> !UnwindSafe for Runtime<S, A>
impl<S, A> Freeze for Runtime<S, A>where
A: Freeze,
Kernel<S>: Freeze,
Receiver<AppCommand<S>>: Freeze,
Arc<ArcSwapAny<Arc<VisualSnapshot<S>>>>: Freeze,
Vec<AppCommand<S>>: Freeze,
impl<S, A> Send for Runtime<S, A>where
A: Send,
Kernel<S>: Send,
Receiver<AppCommand<S>>: Send,
Arc<ArcSwapAny<Arc<VisualSnapshot<S>>>>: Send,
Vec<AppCommand<S>>: Send,
impl<S, A> Unpin for Runtime<S, A>where
A: Unpin,
Kernel<S>: Unpin,
Receiver<AppCommand<S>>: Unpin,
Arc<ArcSwapAny<Arc<VisualSnapshot<S>>>>: Unpin,
Vec<AppCommand<S>>: Unpin,
impl<S, A> UnsafeUnpin for Runtime<S, A>where
A: UnsafeUnpin,
Kernel<S>: UnsafeUnpin,
Receiver<AppCommand<S>>: UnsafeUnpin,
Arc<ArcSwapAny<Arc<VisualSnapshot<S>>>>: UnsafeUnpin,
Vec<AppCommand<S>>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more