rok::core::collections::heap
rok::core::collections::heap - BinaryHeap<T>, a priority queue
over a List laid out as an implicit binary tree. new() pops the
greatest item first; by(before) takes the order: before(a, b)
puts a nearer the top.
Structs
BinaryHeap
pub struct BinaryHeap<T>pub const fn new() -> BinaryHeap<T>A max-heap.
pub const fn by(before: fn(T, T) -> bool) -> BinaryHeap<T>A heap whose top is the item
beforeranks first.pub const fn len(self) -> usizepub fn is_empty(self) -> boolpub const fn peek(self) -> T | noneThe top item.
pub const fn push(self, x: T)pub const fn pop(self) -> T | noneRemove and return the top item.
pub fn clear(self)pub const fn retain(self, keep: fn(T) -> bool)Keep only the items
keepaccepts; O(n).pub const fn iter(self) -> ListIter<T>Every item, in no particular order.
Trait implementations 1
impl<T> !Sync for BinaryHeap<T>