Crates.io | sortbuf |
lib.rs | sortbuf |
version | 0.1.0 |
source | src |
created_at | 2022-06-26 11:03:38.546849 |
updated_at | 2022-06-26 11:03:38.546849 |
description | Data structure for sorting large numbers of items |
homepage | |
repository | |
max_upload_size | |
id | 613503 |
size | 45,170 |
This library provides types and traits for accumulating a large number of items
in memory and iterating over them in ascending or descending order. It
outperforms BTree
-based sorting, introduces low memory overhead and allows
insertion of items from multiple threads as well as reacting to allocation
failures without losing data. However, it's sole purpose is sorting and it
provides no other functionality.
let mut sortbuf = sortbuf::SortBuf::new();
let mut inserter = sortbuf::Inserter::new(&mut sortbuf);
inserter.insert_items([10, 20, 5, 17]).expect("Failed to insert items");
drop(inserter);
assert!(sortbuf.into_iter().eq([20, 17, 10, 5]));
This work is provided under the MIT license. See LICENSE
for more details.