pub trait PQueueOperations<T> {
// Required methods
fn new() -> Self;
fn update(&self, item: T, new_score: i64);
fn peek(&self) -> Option<T>;
fn next(&self) -> Option<T>;
fn score(&self, item: &T) -> Option<i64>;
fn stats(&self) -> PQueueStats;
}Expand description
Trait defining the core operations for a priority queue. This abstraction allows for different implementations while maintaining a consistent API.
Required Methods§
Sourcefn update(&self, item: T, new_score: i64)
fn update(&self, item: T, new_score: i64)
Updates an item’s score (additive) or adds it if it doesn’t exist.
Sourcefn stats(&self) -> PQueueStats
fn stats(&self) -> PQueueStats
Returns current queue statistics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".