pub struct PriorityEventQueue { /* private fields */ }Expand description
Priority-based event queue for transmission scheduling
Events are organized into 4 priority levels:
- Level 0: CRITICAL - immediate, preempts all other traffic
- Level 1: HIGH - after CRITICAL
- Level 2: NORMAL - default priority
- Level 3: LOW - transmitted when bandwidth available
Implementations§
Source§impl PriorityEventQueue
impl PriorityEventQueue
Sourcepub fn pop(&mut self) -> Option<PeatEvent>
pub fn pop(&mut self) -> Option<PeatEvent>
Pop the highest-priority event
CRITICAL events are always returned first. If no CRITICAL events, returns from HIGH, then NORMAL, then LOW.
Sourcepub fn pop_critical(&mut self) -> Vec<PeatEvent>
pub fn pop_critical(&mut self) -> Vec<PeatEvent>
Pop all CRITICAL events (for immediate transmission)
Returns events in FIFO order within CRITICAL priority.
Sourcepub fn pop_weighted(&mut self, max_events: usize) -> Vec<PeatEvent>
pub fn pop_weighted(&mut self, max_events: usize) -> Vec<PeatEvent>
Pop events from non-critical queues for weighted fair transmission
Returns up to max_events events, weighted by priority:
- HIGH: 50% of allocation
- NORMAL: 35% of allocation
- LOW: 15% of allocation
Unused allocation rolls to lower priorities.
Sourcepub fn has_critical(&self) -> bool
pub fn has_critical(&self) -> bool
Check if there are any CRITICAL events pending
Sourcepub fn len_at_priority(&self, priority: EventPriority) -> usize
pub fn len_at_priority(&self, priority: EventPriority) -> usize
Get count of events at a specific priority level
Trait Implementations§
Source§impl Debug for PriorityEventQueue
impl Debug for PriorityEventQueue
Source§impl Default for PriorityEventQueue
impl Default for PriorityEventQueue
Source§fn default() -> PriorityEventQueue
fn default() -> PriorityEventQueue
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PriorityEventQueue
impl RefUnwindSafe for PriorityEventQueue
impl Send for PriorityEventQueue
impl Sync for PriorityEventQueue
impl Unpin for PriorityEventQueue
impl UnsafeUnpin for PriorityEventQueue
impl UnwindSafe for PriorityEventQueue
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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