pub struct UserPriorityState<E: Copy + Eq + Hash> { /* private fields */ }Expand description
Per-connection priority layer. One instance lives on each user Connection
(and on the client’s single Connection).
Entries are evicted on scope exit for that user.
Implementations§
Source§impl<E: Copy + Eq + Hash> UserPriorityState<E>
impl<E: Copy + Eq + Hash> UserPriorityState<E>
Sourcepub fn get_ref(&self, entity: E) -> EntityPriorityRef<'_, E>
pub fn get_ref(&self, entity: E) -> EntityPriorityRef<'_, E>
Returns a read-only priority handle for entity in this user’s layer.
Sourcepub fn get_mut(&mut self, entity: E) -> EntityPriorityMut<'_, E>
pub fn get_mut(&mut self, entity: E) -> EntityPriorityMut<'_, E>
Returns a mutable priority handle for entity in this user’s layer.
Sourcepub fn on_scope_exit(&mut self, entity: &E)
pub fn on_scope_exit(&mut self, entity: &E)
Evict this entity’s per-user entry. Called on scope exit or connection drop.
Sourcepub fn gain_override(&self, entity: &E) -> Option<f32>
pub fn gain_override(&self, entity: &E) -> Option<f32>
Read-only gain lookup for this user layer.
Sourcepub fn advance(&mut self, entity: E, gain: f32) -> f32
pub fn advance(&mut self, entity: E, gain: f32) -> f32
Per-tick advance hook used by the send-side k-way merge.
Adds gain to the entity’s accumulator (lazy-creating the entry) and
returns the new accumulated value.
This is the canonical “accumulator += effective_gain per tick” rule from PRIORITY_ACCUMULATOR_PLAN.md III.7.1.
Sourcepub fn accumulated(&self, entity: &E) -> f32
pub fn accumulated(&self, entity: &E) -> f32
Read accumulator without advancing.
Sourcepub fn reset_after_send(&mut self, entity: &E, current_tick: u32)
pub fn reset_after_send(&mut self, entity: &E, current_tick: u32)
Reset the accumulator to 0 and stamp last_sent_tick. Called for each
entity whose update bundle fully drained in the current send cycle —
the canonical reset-on-send rule from III.7.5.