pub struct GlobalPriorityState<E: Copy + Eq + Hash> { /* private fields */ }Expand description
Sender-wide priority layer. One instance lives on WorldServer.
Entries are evicted on entity despawn.
Combined multiplicatively with each UserPriorityState entry at sort time:
effective_gain = global.gain.unwrap_or(1.0) × user.gain.unwrap_or(1.0).
Implementations§
Source§impl<E: Copy + Eq + Hash> GlobalPriorityState<E>
impl<E: Copy + Eq + Hash> GlobalPriorityState<E>
Sourcepub fn get_ref(&self, entity: E) -> EntityPriorityRef<'_, E>
pub fn get_ref(&self, entity: E) -> EntityPriorityRef<'_, E>
Read-only handle (lazy — returns None if no entry exists).
Sourcepub fn get_mut(&mut self, entity: E) -> EntityPriorityMut<'_, E>
pub fn get_mut(&mut self, entity: E) -> EntityPriorityMut<'_, E>
Mutable handle; lazy entry creation deferred to first write.
Sourcepub fn on_despawn(&mut self, entity: &E)
pub fn on_despawn(&mut self, entity: &E)
Evict this entity’s global entry. Called from WorldServer::despawn_entity.
Sourcepub fn gain_override(&self, entity: &E) -> Option<f32>
pub fn gain_override(&self, entity: &E) -> Option<f32>
Read-only gain lookup. None if no override is in effect (default 1.0
applies). Used by the send-time priority sort to compute effective gain.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for GlobalPriorityState<E>
impl<E> RefUnwindSafe for GlobalPriorityState<E>where
E: RefUnwindSafe,
impl<E> Send for GlobalPriorityState<E>where
E: Send,
impl<E> Sync for GlobalPriorityState<E>where
E: Sync,
impl<E> Unpin for GlobalPriorityState<E>where
E: Unpin,
impl<E> UnsafeUnpin for GlobalPriorityState<E>
impl<E> UnwindSafe for GlobalPriorityState<E>where
E: UnwindSafe,
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