Skip to main content

group_rows

Function group_rows 

Source
pub fn group_rows<T, K, F>(rows: Vec<T>, key: F) -> BTreeMap<K, Vec<T>>
where K: Ord, F: Fn(&T) -> K,
Expand description

Group already-extracted rows by a key function.

Plain Rust — no SEXP contact, so the result is Send (given T: Send) and safe to iterate with rayon. Keys order by Ord; give NA-able keys a home by keying on Option<T> (None sorts first) or a custom enum.