pub struct PriorityQueue { /* private fields */ }Expand description
Thread-safe priority queue for fragments
Implementations§
Source§impl PriorityQueue
impl PriorityQueue
Sourcepub fn push(&self, fragment: PrioritizedFragment)
pub fn push(&self, fragment: PrioritizedFragment)
Push a fragment onto the queue
Sourcepub fn pop(&self) -> Option<PrioritizedFragment>
pub fn pop(&self) -> Option<PrioritizedFragment>
Pop the highest priority fragment
Sourcepub fn peek(&self) -> Option<PrioritizedFragment>
pub fn peek(&self) -> Option<PrioritizedFragment>
Peek at the highest priority fragment
Sourcepub fn contains(&self, fragment_id: &FragmentId) -> bool
pub fn contains(&self, fragment_id: &FragmentId) -> bool
Check if a fragment is already queued
Sourcepub fn update_priority(&self, fragment_id: &FragmentId, new_priority: Priority)
pub fn update_priority(&self, fragment_id: &FragmentId, new_priority: Priority)
Update priority of a fragment
Sourcepub fn get_by_priority(
&self,
min_priority: Priority,
) -> Vec<PrioritizedFragment>
pub fn get_by_priority( &self, min_priority: Priority, ) -> Vec<PrioritizedFragment>
Get all fragments at or above a priority level
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PriorityQueue
impl RefUnwindSafe for PriorityQueue
impl Send for PriorityQueue
impl Sync for PriorityQueue
impl Unpin for PriorityQueue
impl UnwindSafe for PriorityQueue
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