pub struct SchedulerHandle { /* private fields */ }Expand description
A handle to a running scheduler, allowing the caller to stop it later.
Implementations§
Source§impl SchedulerHandle
Implements lifecycle management for SchedulerHandle.
impl SchedulerHandle
Implements lifecycle management for SchedulerHandle.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns whether the scheduler is currently running.
§Returns
bool- True if the scheduler is running.
Sourcepub fn update_count(&self) -> u64
pub fn update_count(&self) -> u64
Sourcepub fn frame_count(&self) -> u64
pub fn frame_count(&self) -> u64
Sourcepub fn start(config: SchedulerConfig, handler: TickHandlerRc) -> SchedulerHandle
pub fn start(config: SchedulerConfig, handler: TickHandlerRc) -> SchedulerHandle
Starts the scheduler with the given configuration and handler.
Creates a requestAnimationFrame-driven loop that calls tick
on each animation frame. The returned SchedulerHandle can be used to stop the scheduler.
§Arguments
SchedulerConfig- The scheduler configuration.TickHandlerRc- The handler receiving update and render callbacks.
§Returns
SchedulerHandle- A handle to control the running scheduler.
Source§impl SchedulerHandle
impl SchedulerHandle
pub fn new( state: Rc<RefCell<SchedulerState>>, closure_cell: RafClosureCell, ) -> Self
Trait Implementations§
Source§impl Clone for SchedulerHandle
impl Clone for SchedulerHandle
Source§fn clone(&self) -> SchedulerHandle
fn clone(&self) -> SchedulerHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SchedulerHandle
impl !Send for SchedulerHandle
impl !Sync for SchedulerHandle
impl !UnwindSafe for SchedulerHandle
impl Freeze for SchedulerHandle
impl Unpin for SchedulerHandle
impl UnsafeUnpin for SchedulerHandle
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