pub struct TanStackSortedFlatRowOrderCache { /* private fields */ }Implementations§
Source§impl TanStackSortedFlatRowOrderCache
impl TanStackSortedFlatRowOrderCache
pub fn recompute_count(&self) -> u64
pub fn filtered_recompute_count(&self) -> u64
Sourcepub fn sorted_order<'a, TData>(
&mut self,
data: &'a [TData],
columns: &[ColumnDef<TData>],
get_row_key: &dyn Fn(&TData, usize, Option<&RowKey>) -> RowKey,
filter_fns: &HashMap<Arc<str>, FilterFnDef>,
sorting_fns: &HashMap<Arc<str>, SortingFnDef<TData>>,
get_column_can_global_filter: Option<&dyn Fn(&ColumnDef<TData>, &TData) -> bool>,
deps: TanStackSortedFlatRowOrderDeps,
) -> (&Arc<[FlatRowOrderEntry]>, bool)
pub fn sorted_order<'a, TData>( &mut self, data: &'a [TData], columns: &[ColumnDef<TData>], get_row_key: &dyn Fn(&TData, usize, Option<&RowKey>) -> RowKey, filter_fns: &HashMap<Arc<str>, FilterFnDef>, sorting_fns: &HashMap<Arc<str>, SortingFnDef<TData>>, get_column_can_global_filter: Option<&dyn Fn(&ColumnDef<TData>, &TData) -> bool>, deps: TanStackSortedFlatRowOrderDeps, ) -> (&Arc<[FlatRowOrderEntry]>, bool)
Returns a stable, memoized ordering of the root row list after filtering + sorting.
Notes:
- This cache is designed for “rebuild every frame” callers. Keep it outside the ephemeral table instance and feed dependency snapshots.
- Dependency tracking is explicit via
deps. If you change any inputs that are not represented indeps(e.g.filter_fns,sorting_fns, or the closure identities), you must reset the cache (or bump a revision captured indeps).
Trait Implementations§
Source§impl Default for TanStackSortedFlatRowOrderCache
impl Default for TanStackSortedFlatRowOrderCache
Source§fn default() -> TanStackSortedFlatRowOrderCache
fn default() -> TanStackSortedFlatRowOrderCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TanStackSortedFlatRowOrderCache
impl RefUnwindSafe for TanStackSortedFlatRowOrderCache
impl Send for TanStackSortedFlatRowOrderCache
impl Sync for TanStackSortedFlatRowOrderCache
impl Unpin for TanStackSortedFlatRowOrderCache
impl UnsafeUnpin for TanStackSortedFlatRowOrderCache
impl UnwindSafe for TanStackSortedFlatRowOrderCache
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
Mutably borrows from an owned value. Read more