16 lines
579 B
Rust
16 lines
579 B
Rust
/// Data structures for the "indexed" min-queues, supporting priority updates and arbitrary removals, but no duplicates
|
|
mod binary_heap;
|
|
|
|
pub use binary_heap::IndexedBinaryHeap;
|
|
|
|
use super::{containers::Pair, pure::PureBacking};
|
|
|
|
/// A data structure usable for backing an "indexed" queue
|
|
pub trait IndexedBacking<D: Clone + Send + Sync, P: PartialOrd + Clone + Send + Sync>:
|
|
PureBacking<Pair<D, P>>
|
|
{
|
|
/// Update an item's priority
|
|
fn update(&mut self, data: D, priority: P) -> bool;
|
|
/// Remove an item from the queue
|
|
fn remove(&mut self, data: D) -> bool;
|
|
}
|