Crates.io | dotreds-binary-heap-plus |
lib.rs | dotreds-binary-heap-plus |
version | 1.0.3 |
source | src |
created_at | 2022-04-21 15:32:44.786688 |
updated_at | 2022-04-21 16:26:03.717327 |
description | Enhanced version of std::collections::BinaryHeap that supports max, min, and custom-order heaps. Makes some previously internal function public |
homepage | |
repository | https://github.com/sekineh/binary-heap-plus-rs |
max_upload_size | |
id | 571670 |
size | 30,324 |
Enhancement over Rust's std::collections::BinaryHeap
.
This version of Binary-heap-plus makes some private functions public.
It supports the following heaps and still maintains backward compatibility.
BinaryHeap::new()
or ::with_capacity()
BinaryHeap::new_min()
or ::with_capacity_min()
BinaryHeap::new_by()
or ::with_capacity_by()
BinaryHeap::new_by_key()
or ::with_capacity_by_key()
Other notable added methods are:
BinaryHeap::from_vec_cmp()
and BinaryHeap::from_vec()
for more generic construction..into_iter_sorted()
which is less-surprising version of .into_iter()
. The implementation is backported from std
..replace_cmp()
which replace the comparator of the existing heap.This crate requires Rust 1.32.0 or later.
See CHANGELOG.md. https://github.com/sekineh/binary-heap-plus-rs/blob/master/CHANGELOG.md
serde1
.unsafe
perf optimazation.See the following discussions for the background of the crate: