Skip to main content

ColumnDef

Struct ColumnDef 

Source
pub struct ColumnDef<TData> {
Show 30 fields pub id: Arc<str>, pub columns: Vec<ColumnDef<TData>>, pub sort_cmp: Option<Arc<dyn Fn(&TData, &TData) -> Ordering>>, pub sorting_fn: Option<SortingFnSpec>, pub sort_value: Option<Arc<dyn Fn(&TData) -> TanStackValue>>, pub sort_undefined: Option<SortUndefined>, pub sort_is_undefined: Option<Arc<dyn Fn(&TData) -> bool>>, pub filtering_fn: Option<FilteringFnSpec>, pub filter_fn: Option<Arc<dyn Fn(&TData, &Value) -> bool>>, pub filter_fn_with_meta: Option<Arc<dyn Fn(&TData, &Value, &mut dyn FnMut(Value)) -> bool>>, pub facet_key_fn: Option<Arc<dyn Fn(&TData) -> u64>>, pub facet_str_fn: Option<Arc<dyn for<'r> Fn(&'r TData) -> &'r str>>, pub value_u64_fn: Option<Arc<dyn Fn(&TData) -> u64>>, pub unique_values_fn: Option<Arc<dyn Fn(&TData, usize) -> Vec<TanStackValue>>>, pub invert_sorting: bool, pub sort_desc_first: Option<bool>, pub enable_sorting: bool, pub enable_multi_sort: bool, pub enable_column_filter: bool, pub enable_global_filter: bool, pub aggregation: Aggregation, pub aggregation_fn: AggregationFnSpec, pub enable_hiding: bool, pub enable_ordering: bool, pub enable_pinning: bool, pub enable_resizing: bool, pub enable_grouping: bool, pub size: f32, pub min_size: f32, pub max_size: f32,
}

Fields§

§id: Arc<str>§columns: Vec<ColumnDef<TData>>

Child columns for TanStack-style grouped column definitions.

When non-empty, this column is treated as a “group” column for header group generation.

§sort_cmp: Option<Arc<dyn Fn(&TData, &TData) -> Ordering>>§sorting_fn: Option<SortingFnSpec>§sort_value: Option<Arc<dyn Fn(&TData) -> TanStackValue>>§sort_undefined: Option<SortUndefined>§sort_is_undefined: Option<Arc<dyn Fn(&TData) -> bool>>§filtering_fn: Option<FilteringFnSpec>§filter_fn: Option<Arc<dyn Fn(&TData, &Value) -> bool>>§filter_fn_with_meta: Option<Arc<dyn Fn(&TData, &Value, &mut dyn FnMut(Value)) -> bool>>§facet_key_fn: Option<Arc<dyn Fn(&TData) -> u64>>§facet_str_fn: Option<Arc<dyn for<'r> Fn(&'r TData) -> &'r str>>§value_u64_fn: Option<Arc<dyn Fn(&TData) -> u64>>§unique_values_fn: Option<Arc<dyn Fn(&TData, usize) -> Vec<TanStackValue>>>§invert_sorting: bool§sort_desc_first: Option<bool>§enable_sorting: bool§enable_multi_sort: bool§enable_column_filter: bool§enable_global_filter: bool§aggregation: Aggregation§aggregation_fn: AggregationFnSpec§enable_hiding: bool§enable_ordering: bool§enable_pinning: bool§enable_resizing: bool§enable_grouping: bool§size: f32§min_size: f32§max_size: f32

Implementations§

Source§

impl<TData> ColumnDef<TData>

Source

pub fn new(id: impl Into<Arc<str>>) -> ColumnDef<TData>

Source

pub fn sort_by( self, cmp: impl Fn(&TData, &TData) -> Ordering + 'static, ) -> ColumnDef<TData>

Source

pub fn columns(self, columns: Vec<ColumnDef<TData>>) -> ColumnDef<TData>

TanStack-aligned: configure columns for grouped column definitions.

Source

pub fn sort_value_by( self, get_value: impl Fn(&TData) -> TanStackValue + 'static, ) -> ColumnDef<TData>

Provide a TanStack-like getValue(columnId) accessor for built-in sortingFn behaviors.

Source

pub fn unique_values_by( self, get_unique_values: impl Fn(&TData, usize) -> Vec<TanStackValue> + 'static, ) -> ColumnDef<TData>

TanStack-aligned: configure columnDef.getUniqueValues for row.getUniqueValues(columnId).

Source

pub fn aggregation_fn_auto(self) -> ColumnDef<TData>

TanStack-aligned: configure aggregationFn: 'auto'.

Source

pub fn aggregation_fn_builtin( self, agg: BuiltInAggregationFn, ) -> ColumnDef<TData>

TanStack-aligned: configure a built-in aggregation function key.

Source

pub fn aggregation_fn_named(self, key: impl Into<Arc<str>>) -> ColumnDef<TData>

TanStack-aligned: configure aggregationFn: <string> resolved via options.aggregationFns.

Source

pub fn aggregation_fn_none(self) -> ColumnDef<TData>

Disable aggregation for this column.

Source

pub fn sorting_fn_auto(self) -> ColumnDef<TData>

TanStack-aligned: configure sortingFn: 'auto'.

Source

pub fn sorting_fn_builtin( self, sorting_fn: BuiltInSortingFn, ) -> ColumnDef<TData>

TanStack-aligned: configure a built-in sorting function key.

Source

pub fn sorting_fn_named(self, key: impl Into<Arc<str>>) -> ColumnDef<TData>

TanStack-aligned: configure sortingFn: <string> resolved via table options.

Source

pub fn filtering_fn_auto(self) -> ColumnDef<TData>

TanStack-aligned: configure filterFn: 'auto'.

Source

pub fn filtering_fn_builtin( self, filter_fn: BuiltInFilterFn, ) -> ColumnDef<TData>

TanStack-aligned: configure a built-in filter function key.

Source

pub fn filtering_fn_named(self, key: impl Into<Arc<str>>) -> ColumnDef<TData>

TanStack-aligned: configure filterFn: <string> resolved via table options.

Source

pub fn sort_undefined_by( self, sort_undefined: SortUndefined, is_undefined: impl Fn(&TData) -> bool + 'static, ) -> ColumnDef<TData>

TanStack-aligned: configure sortUndefined semantics for this column.

is_undefined must match the column’s getValue(column_id) === undefined behavior in TanStack.

Source

pub fn sort_undefined_disabled(self) -> ColumnDef<TData>

TanStack-aligned: sortUndefined: false (disable undefined pre-pass ordering).

Source

pub fn invert_sorting(self, invert: bool) -> ColumnDef<TData>

TanStack-aligned: invert the meaning of asc vs desc for this column.

This mirrors columnDef.invertSorting in TanStack Table v8: after the base sorting function yields an ordering, the result is inverted.

Source

pub fn sort_desc_first(self, enabled: bool) -> ColumnDef<TData>

TanStack-aligned: start sort toggles in descending order for this column.

This mirrors columnDef.sortDescFirst in TanStack Table v8.

Source

pub fn enable_sorting(self, enabled: bool) -> ColumnDef<TData>

TanStack-aligned: enable/disable sorting for this column.

This mirrors columnDef.enableSorting in TanStack Table v8.

Source

pub fn enable_multi_sort(self, enabled: bool) -> ColumnDef<TData>

TanStack-aligned: enable/disable multi-sort for this column.

This mirrors columnDef.enableMultiSort in TanStack Table v8.

Source

pub fn enable_column_filter(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn enable_global_filter(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn filter_by( self, f: impl Fn(&TData, &str) -> bool + 'static, ) -> ColumnDef<TData>

Source

pub fn filter_by_with_meta( self, f: impl Fn(&TData, &Value, &mut dyn FnMut(Value)) -> bool + 'static, ) -> ColumnDef<TData>

Configure a custom filterFn with TanStack-like addMeta support.

Source

pub fn facet_key_by( self, f: impl Fn(&TData) -> u64 + 'static, ) -> ColumnDef<TData>

Provide a stable u64 facet key for this column (TanStack-aligned faceting, Rust-native).

Source

pub fn facet_str_by( self, f: impl for<'r> Fn(&'r TData) -> &'r str + 'static, ) -> ColumnDef<TData>

Provide a string view for this column’s facet value (borrowed from row data; no allocation).

Source

pub fn value_u64_by( self, f: impl Fn(&TData) -> u64 + 'static, ) -> ColumnDef<TData>

Provide a stable numeric value for this column.

This is the preferred input for numeric aggregation (and future numeric sorting/filtering). It is intentionally separate from facet_key_by, which is reserved for grouping/faceting.

Source

pub fn aggregate(self, aggregation: Aggregation) -> ColumnDef<TData>

Source

pub fn enable_hiding(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn enable_ordering(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn enable_pinning(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn enable_resizing(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn enable_grouping(self, enabled: bool) -> ColumnDef<TData>

Source

pub fn size(self, size: f32) -> ColumnDef<TData>

Source

pub fn min_size(self, min_size: f32) -> ColumnDef<TData>

Source

pub fn max_size(self, max_size: f32) -> ColumnDef<TData>

Trait Implementations§

Source§

impl<TData> Clone for ColumnDef<TData>

Source§

fn clone(&self) -> ColumnDef<TData>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TData> Debug for ColumnDef<TData>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<TData> Freeze for ColumnDef<TData>

§

impl<TData> !RefUnwindSafe for ColumnDef<TData>

§

impl<TData> !Send for ColumnDef<TData>

§

impl<TData> !Sync for ColumnDef<TData>

§

impl<TData> Unpin for ColumnDef<TData>

§

impl<TData> UnsafeUnpin for ColumnDef<TData>

§

impl<TData> !UnwindSafe for ColumnDef<TData>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UiElementA11yExt for T

Source§

fn a11y(self, decoration: SemanticsDecoration) -> UiElementWithA11y<Self>

Source§

fn a11y_role(self, role: SemanticsRole) -> UiElementWithA11y<Self>

Source§

fn a11y_label(self, label: impl Into<Arc<str>>) -> UiElementWithA11y<Self>

Source§

fn a11y_value(self, value: impl Into<Arc<str>>) -> UiElementWithA11y<Self>

Source§

fn a11y_disabled(self, disabled: bool) -> UiElementWithA11y<Self>

Source§

fn a11y_selected(self, selected: bool) -> UiElementWithA11y<Self>

Source§

fn a11y_expanded(self, expanded: bool) -> UiElementWithA11y<Self>

Source§

fn a11y_checked(self, checked: Option<bool>) -> UiElementWithA11y<Self>

Source§

impl<T> UiElementKeyContextExt for T

Source§

fn key_context( self, key_context: impl Into<Arc<str>>, ) -> UiElementWithKeyContext<Self>

Source§

impl<T> UiElementTestIdExt for T

Source§

fn test_id(self, id: impl Into<Arc<str>>) -> UiElementWithTestId<Self>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more