pub enum AndonState {
Normal,
Warning {
buffer_pct: u8,
},
TraceLoss {
dropped_count: u64,
},
}Expand description
Soft Andon state for visual trace loss indication (MacKenzie & Ware 1993).
Per MacKenzie & Ware (1993): “Input lag degrades human performance.” Hard blocking (AndonCord) creates lag; SoftAndon preserves responsiveness while making trace loss visually impossible to ignore.
§Examples
use jugar_web::trace::AndonState;
let state = AndonState::Normal;
assert_eq!(state.overlay_color(), [0.0, 0.0, 0.0, 0.0]); // Invisible
let warning = AndonState::Warning { buffer_pct: 85 };
assert!(warning.overlay_color()[3] > 0.0); // Visible yellow
let loss = AndonState::TraceLoss { dropped_count: 10 };
assert!(loss.overlay_color()[3] > 0.0); // Visible redVariants§
Normal
Normal operation - all events being recorded.
Warning
Warning - buffer at 80%+ capacity.
TraceLoss
Trace loss - events are being dropped.
Implementations§
Source§impl AndonState
impl AndonState
Sourcepub const fn overlay_color(&self) -> [f32; 4]
pub const fn overlay_color(&self) -> [f32; 4]
Get HUD overlay color (Visual Management).
Returns RGBA color for drawing over the game canvas.
Sourcepub const fn status_text(&self) -> &'static str
pub const fn status_text(&self) -> &'static str
Get status text for HUD display.
Sourcepub const fn has_dropped(&self) -> bool
pub const fn has_dropped(&self) -> bool
Check if any events have been dropped.
Sourcepub const fn dropped_count(&self) -> u64
pub const fn dropped_count(&self) -> u64
Get number of dropped frames (0 if none).
Trait Implementations§
Source§impl Clone for AndonState
impl Clone for AndonState
Source§fn clone(&self) -> AndonState
fn clone(&self) -> AndonState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AndonState
impl Debug for AndonState
Source§impl Default for AndonState
impl Default for AndonState
Source§fn default() -> AndonState
fn default() -> AndonState
Returns the “default value” for a type. Read more
Source§impl PartialEq for AndonState
impl PartialEq for AndonState
impl Copy for AndonState
impl Eq for AndonState
impl StructuralPartialEq for AndonState
Auto Trait Implementations§
impl Freeze for AndonState
impl RefUnwindSafe for AndonState
impl Send for AndonState
impl Sync for AndonState
impl Unpin for AndonState
impl UnwindSafe for AndonState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more