pyority_queue/src/backing/pure/mod.rs
Michael Bradley 38a544db76
Add PyItem container
Also reduce queue item trait bound from Ord to just PartialOrd
2025-01-10 20:53:28 +13:00

13 lines
504 B
Rust

/// Data structures for the "pure" min-queues, supporting duplicates but no arbitrary updates
mod binary_heap;
pub use binary_heap::BinaryHeap;
/// A data structure usable for backing a "pure" queue
pub trait PureBacking<T: PartialOrd + Send + Sync>: Send + Sync {
/// Places an item into the queue
fn add(&mut self, item: T);
/// Removes the item with minimum priority, if it exists
fn pop(&mut self) -> Option<T>;
/// The number of items in the queue
fn len(&self) -> usize;
}