| Crates.io | pqueue |
| lib.rs | pqueue |
| version | 0.2.0 |
| created_at | 2022-05-05 17:19:06.555237+00 |
| updated_at | 2025-06-01 21:49:11.351883+00 |
| description | Priority Queue for Rust |
| homepage | |
| repository | https://github.com/tidwall/pqueue |
| max_upload_size | |
| id | 581152 |
| size | 6,083 |
A fast little priority queue for Rust.
Allows for items that have the PartialOrd trait.
Here we create a queue of simple integers.
let items = [9, 5, 1, 3, 4, 2, 6, 8, 9, 2, 1];
let mut q = pqueue::Queue::new();
for item in items {
q.push(item);
}
while let Some(item) = q.pop() {
println!("{}", item);
}
// OUTPUT:
// 1
// 1
// 2
// 2
// 3
// 4
// 5
// 6
// 8
// 9
// 9