sort_by_derive
This crate provides the #[derive(SortBy)] derive macro that implements the traits Ord, PartialOrd, Eq, PartialEq and Hash on structs that can't automatically derive those traits because they contain unorderable fields such as f32.
Fields that must be included in the sorting are explicitly marked with the attribute #[sort_by], unmarked fields will be ignored.
As with #[derive(Ord)] and #[derive(PartialEq)], order of sorting is the same as the order of appearance of fields.
Example
expands to
From there sort can be called on a Vec<Toto>.
Limitations
Only structs with named fields are supported.