pub struct Runtime { /* private fields */ }Expand description
Owns the state cells, UI tasks, frame callbacks and invalidated scopes of one composition. Clones share the same runtime.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new(scheduler: SchedulerRef) -> Self
pub fn new(scheduler: SchedulerRef) -> Self
Creates a runtime whose UI thread is the current thread. scheduler is asked for a frame
whenever the runtime has work.
Sourcepub fn handle(&self) -> RuntimeHandle
pub fn handle(&self) -> RuntimeHandle
Returns a handle that reaches this runtime without keeping it alive.
Sourcepub fn has_updates(&self) -> bool
pub fn has_updates(&self) -> bool
Returns true if node updates are queued or any recompose scope is invalid.
Sourcepub fn needs_frame(&self) -> bool
pub fn needs_frame(&self) -> bool
Returns true if the runtime has asked for a frame or has a task ready to run.
Sourcepub fn set_needs_frame(&self, value: bool)
pub fn set_needs_frame(&self, value: bool)
Sets or clears the request for a frame.
Sourcepub fn last_frame_time_nanos(&self) -> Option<u64>
pub fn last_frame_time_nanos(&self) -> Option<u64>
Animation-clock time of the most recent frame-callback drain. This is
the same clock Animatables advance on (virtual under robot exact
captures), so per-frame integrators derive dt from it instead of wall
time.
Sourcepub fn frame_clock(&self) -> FrameClock
pub fn frame_clock(&self) -> FrameClock
Returns a clock for the frames of this runtime.