pub struct GroupIndex {
pub groups: Vec<GroupMeta>,
pub key_names: Vec<String>,
}Expand description
A deterministic group index built from a TidyView.
Groups are created in first-occurrence order: the first time a key combination appears (scanning visible rows in ascending base-row order), a new group entry is appended. This guarantees a stable, reproducible output ordering regardless of hash-map iteration order.
No column buffers are copied during group construction.
Fields§
§groups: Vec<GroupMeta>Groups in first-occurrence order.
key_names: Vec<String>The column names used as group keys (projected names).
Implementations§
Source§impl GroupIndex
impl GroupIndex
Source§impl GroupIndex
impl GroupIndex
Sourcepub fn build_fast<I: IntoIterator<Item = usize>>(
base: &DataFrame,
key_col_indices: &[usize],
visible_rows: I,
key_names: Vec<String>,
) -> Self
pub fn build_fast<I: IntoIterator<Item = usize>>( base: &DataFrame, key_col_indices: &[usize], visible_rows: I, key_names: Vec<String>, ) -> Self
Build a GroupIndex using a BTree-accelerated lookup.
Semantics: identical to GroupIndex::build(). First-occurrence group
ordering is preserved. The only difference is O(N log G) vs O(N × G).
Phase 2 (v3) cat-aware fast path: when every key column is
Column::Categorical, the lookup BTreeMap keys are
Vec<u32> of category codes instead of Vec<String> of display
values. This eliminates levels[code].clone() per row per key
column. The fast path is bit-identical to the string path:
- Group slots are still assigned in first-occurrence row order.
GroupMeta::key_valuesis stillVec<String>of display values, computed once per group (not once per row).- Mixed-type keys (e.g., categorical + int) fall back to the string path automatically.
Trait Implementations§
Source§impl Clone for GroupIndex
impl Clone for GroupIndex
Source§fn clone(&self) -> GroupIndex
fn clone(&self) -> GroupIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for GroupIndex
impl RefUnwindSafe for GroupIndex
impl Send for GroupIndex
impl Sync for GroupIndex
impl Unpin for GroupIndex
impl UnsafeUnpin for GroupIndex
impl UnwindSafe for GroupIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more