Update Rust structure to better match proposed Python API

This commit is contained in:
Michael Bradley 2025-01-08 23:00:24 +13:00
parent b4ca806d76
commit ffe6a76241
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
6 changed files with 18 additions and 18 deletions

View file

@ -0,0 +1,12 @@
/// Data structures for the "indexed" min-queues, supporting priority updates and arbitrary removals, but no duplicates
use super::{item::Item, pure::PureBacking};
/// A data structure usable for backing an "indexed" queue
pub trait IndexedBacking<D: Clone + Send + Sync, P: Ord + Clone + Send + Sync>:
PureBacking<Item<D, P>>
{
/// Update an item's priority
fn update(data: D, priority: P) -> Result<(), ()>;
/// Remove an item from the queue
fn remove(data: D) -> bool;
}