sortbuf

Crates.iosortbuf
lib.rssortbuf
version0.1.0
sourcesrc
created_at2022-06-26 11:03:38.546849
updated_at2022-06-26 11:03:38.546849
descriptionData structure for sorting large numbers of items
homepage
repository
max_upload_size
id613503
size45,170
maintainers (github:ngyn-rs:maintainers)

documentation

README

sortbuf -- data structure for sorting large numbers of items in memory

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.

Example

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]));

License

This work is provided under the MIT license. See LICENSE for more details.

Commit count: 0

cargo fmt