pub struct PriorityQueue<T> { /* private fields */ }Expand description
Typed, stable priority queue for host-controlled execution.
The queue never executes values itself. Lower numeric priorities are scheduled first, and insertion order is preserved within each priority.
Implementations§
Source§impl<T> PriorityQueue<T>
impl<T> PriorityQueue<T>
Sourcepub fn push(&mut self, priority: Priority, value: T) -> u64
pub fn push(&mut self, priority: Priority, value: T) -> u64
Submit a value and return its stable insertion sequence.
Sourcepub fn pop(&mut self) -> Option<PriorityItem<T>>
pub fn pop(&mut self) -> Option<PriorityItem<T>>
Claim the highest-priority pending value.
Sourcepub fn restore(&mut self, item: PriorityItem<T>)
pub fn restore(&mut self, item: PriorityItem<T>)
Return a previously claimed item without changing its original FIFO position. This is intended for admission failures and other cases where execution never acquired ownership of the work.
Sourcepub fn ordered(&self) -> Vec<&PriorityItem<T>>
pub fn ordered(&self) -> Vec<&PriorityItem<T>>
Borrow pending items in the exact order in which they will be claimed.
Trait Implementations§
Source§impl<T: Debug> Debug for PriorityQueue<T>
impl<T: Debug> Debug for PriorityQueue<T>
Auto Trait Implementations§
impl<T> Freeze for PriorityQueue<T>
impl<T> RefUnwindSafe for PriorityQueue<T>where
T: RefUnwindSafe,
impl<T> Send for PriorityQueue<T>where
T: Send,
impl<T> Sync for PriorityQueue<T>where
T: Sync,
impl<T> Unpin for PriorityQueue<T>where
T: Unpin,
impl<T> UnsafeUnpin for PriorityQueue<T>
impl<T> UnwindSafe for PriorityQueue<T>where
T: 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