Add PyItem container

Also reduce queue item trait bound from Ord to just PartialOrd
This commit is contained in:
Michael Bradley 2025-01-10 20:53:28 +13:00
parent ee004bac19
commit 38a544db76
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
8 changed files with 91 additions and 32 deletions

View file

@ -3,7 +3,7 @@ mod binary_heap;
pub use binary_heap::BinaryHeap;
/// A data structure usable for backing a "pure" queue
pub trait PureBacking<T: Ord + Send + Sync>: Send + Sync {
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