Update Rust structure to better match proposed Python API
This commit is contained in:
parent
b4ca806d76
commit
ffe6a76241
6 changed files with 18 additions and 18 deletions
12
src/backing/indexed/mod.rs
Normal file
12
src/backing/indexed/mod.rs
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue