pub trait TickStrategy: Send {
// Required methods
fn should_tick(
&mut self,
screen_id: &str,
tick_count: u64,
active_screen: &str,
) -> TickDecision;
fn name(&self) -> &str;
// Provided methods
fn on_screen_transition(&mut self, _from: &str, _to: &str) { ... }
fn maintenance_tick(&mut self, _tick_count: u64) { ... }
fn shutdown(&mut self) { ... }
fn debug_stats(&self) -> Vec<(String, String)> { ... }
}Expand description
Controls which inactive screens get ticked on each frame.
The runtime owns the invariant that the active screen is always ticked.
Implementations should assume should_tick is only called for inactive
screens that are still eligible for work.
Required Methods§
Sourcefn should_tick(
&mut self,
screen_id: &str,
tick_count: u64,
active_screen: &str,
) -> TickDecision
fn should_tick( &mut self, screen_id: &str, tick_count: u64, active_screen: &str, ) -> TickDecision
Decide whether to tick an inactive screen on this frame.
Provided Methods§
Sourcefn on_screen_transition(&mut self, _from: &str, _to: &str)
fn on_screen_transition(&mut self, _from: &str, _to: &str)
Called when the runtime observes a screen transition.
Sourcefn maintenance_tick(&mut self, _tick_count: u64)
fn maintenance_tick(&mut self, _tick_count: u64)
Called periodically for maintenance work.
Sourcefn debug_stats(&self) -> Vec<(String, String)>
fn debug_stats(&self) -> Vec<(String, String)>
Optional key-value debug stats.