appaquet / extsort-rs

External sorting (i.e. on disk sorting) capability on arbitrarily sized iterator
Apache License 2.0
24 stars 5 forks source link

Alternative Sortable definition #4

Closed kkonevets closed 3 years ago

kkonevets commented 4 years ago

Defining Sortable like this is more readable and makes sense

pub trait Sortable: Eq + Ord + Sized + Send + Sync {
    fn encode<W: Write>(&self, writer: &mut W);
    fn decode<R: Read>(reader: &mut R) -> Option<Self>;
}