pub struct InputFairnessGuard { /* private fields */ }Expand description
Guard for input fairness scheduling.
Monitors event processing fairness and triggers interventions when input events are at risk of starvation due to resize processing.
Implementations§
Source§impl InputFairnessGuard
impl InputFairnessGuard
Sourcepub fn with_config(config: FairnessConfig) -> Self
pub fn with_config(config: FairnessConfig) -> Self
Create a new fairness guard with the given configuration.
Sourcepub fn input_arrived(&mut self, now: Instant)
pub fn input_arrived(&mut self, now: Instant)
Signal that an input event has arrived.
Call this when an input event is received but before processing.
Sourcepub fn check_fairness(&mut self, now: Instant) -> FairnessDecision
pub fn check_fairness(&mut self, now: Instant) -> FairnessDecision
Check fairness and return a decision.
Call this before processing a resize event to check if input is starving.
Sourcepub fn event_processed(
&mut self,
event_type: EventType,
duration: Duration,
_now: Instant,
)
pub fn event_processed( &mut self, event_type: EventType, duration: Duration, _now: Instant, )
Record that an event was processed.
Sourcepub fn stats(&self) -> &FairnessStats
pub fn stats(&self) -> &FairnessStats
Get current statistics.
Sourcepub fn intervention_counts(&self) -> &InterventionCounts
pub fn intervention_counts(&self) -> &InterventionCounts
Get intervention counts.
Sourcepub fn config(&self) -> &FairnessConfig
pub fn config(&self) -> &FairnessConfig
Get current configuration.
Sourcepub fn resize_dominance_count(&self) -> u32
pub fn resize_dominance_count(&self) -> u32
Current resize dominance count.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if fairness is enabled.
Sourcepub fn jain_index(&self) -> f64
pub fn jain_index(&self) -> f64
Get current Jain’s fairness index.
Sourcepub fn has_pending_input(&self) -> bool
pub fn has_pending_input(&self) -> bool
Check if there is pending input.
Trait Implementations§
Source§impl Debug for InputFairnessGuard
impl Debug for InputFairnessGuard
Auto Trait Implementations§
impl Freeze for InputFairnessGuard
impl RefUnwindSafe for InputFairnessGuard
impl Send for InputFairnessGuard
impl Sync for InputFairnessGuard
impl Unpin for InputFairnessGuard
impl UnsafeUnpin for InputFairnessGuard
impl UnwindSafe for InputFairnessGuard
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