external_sort
Provides the ability to perform external sorts on structs, which allows for rapid sorting of extremely large data streams.
Usage
Add this to your Cargo.toml:
[]
= "^0.1.1"
and this to your crate root:
extern crate external_sort;
Examples
The following shows using external_sort to sort a vector of simple structs.
Note that your struct must impl Ord, Clone, as well as the serde Serialize and Deserialize traits. Additionally, in order for external_sort to track it's memory buffer usage, your struct must be able to report on it's size (via external_sort::ExternallySortable)
extern crate external_sort;
extern crate serde_derive;
use ;
If your struct is unable to report on it's size, simply return 1 from get_size(), and then pass the number of objects (rather than bytes) that the ExternalSorter should keep in memory when calling ExternalSorter::new()