Rename KeyedQueue to PairedQueue

This commit is contained in:
Michael Bradley 2025-01-09 00:03:01 +13:00
parent 17b544f8bc
commit 6e91aef421
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
5 changed files with 21 additions and 21 deletions

25
src/queue/paired.rs Normal file
View file

@ -0,0 +1,25 @@
// A "pure" priority queue that supports duplicates, but not arbitrary deletions or weight updates
use crate::backing::{
item::Item,
pure::{binary_heap::BinaryHeap, PureBacking},
};
use pyo3::prelude::*;
#[pyclass]
pub struct PairedQueue {
backing: Box<dyn PureBacking<Item<Py<PyAny>, f64>>>,
}
#[pymethods]
impl PairedQueue {
#[new]
fn new() -> Self {
Self {
backing: Box::new(BinaryHeap::new()),
}
}
fn __len__(self_: PyRef<'_, Self>) -> usize {
self_.backing.len()
}
}