pub struct Executor { /* private fields */ }Expand description
Deterministic single-threaded executor: one step is
one frame. The root future and every spawned task are polled once per
step, in a fixed order (root, then tasks in spawn order). No wakers, no
clocks, no threads — the same input always produces the same frames.
Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(
fps: f64,
meta: Meta,
seed: u64,
root: impl Future<Output = ()> + 'static,
) -> Self
pub fn new( fps: f64, meta: Meta, seed: u64, root: impl Future<Output = ()> + 'static, ) -> Self
seed feeds the scene’s random generator (random).
Sourcepub fn enter<R>(&self, f: impl FnOnce() -> R) -> R
pub fn enter<R>(&self, f: impl FnOnce() -> R) -> R
Runs f with this executor’s runtime installed, so that now(),
tune! and friends work outside of step.
Sourcepub fn step(&mut self) -> bool
pub fn step(&mut self) -> bool
Computes the next frame. Returns true if the scene is finished
(its root future completed during this or an earlier step).
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the scene’s root task has completed.
Sourcepub fn frames_done(&self) -> u32
pub fn frames_done(&self) -> u32
Number of frames computed so far; the last computed frame is
frames_done() - 1.
Sourcepub fn meta(&self) -> Meta
pub fn meta(&self) -> Meta
Current markers, eases and tunables, including defaults recorded so far.
Sourcepub fn take_meta_changed(&self) -> bool
pub fn take_meta_changed(&self) -> bool
True if scene code recorded new defaults into the meta since the last call.