pub struct DataTableRowModel<T> { /* private fields */ }Expand description
Row model containing processed rows and index mappings.
Manages the complete row processing pipeline from raw data through filtering, sorting, grouping, expansion, and pagination.
Implementations§
Source§impl<T> DataTableRowModel<T>
impl<T> DataTableRowModel<T>
Sourcepub fn new<F>(data: Vec<T>, id_fn: F) -> DataTableRowModel<T>
pub fn new<F>(data: Vec<T>, id_fn: F) -> DataTableRowModel<T>
Sourcepub fn from_data(data: Vec<T>) -> DataTableRowModel<T>
pub fn from_data(data: Vec<T>) -> DataTableRowModel<T>
Sourcepub fn total_row_count(&self) -> usize
pub fn total_row_count(&self) -> usize
Sourcepub fn filtered_row_count(&self) -> usize
pub fn filtered_row_count(&self) -> usize
Sourcepub fn page_row_count(&self) -> usize
pub fn page_row_count(&self) -> usize
Sourcepub fn all_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
pub fn all_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
Sourcepub fn filtered_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
pub fn filtered_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
Returns filtered rows.
§Returns
impl Iterator<Item = &DataTableRow<T>>: An iterator over filtered rows.
Sourcepub fn sorted_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
pub fn sorted_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
Sourcepub fn visible_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
pub fn visible_rows(&self) -> impl Iterator<Item = &DataTableRow<T>>
Returns the final visible rows (after all processing).
§Returns
impl Iterator<Item = &DataTableRow<T>>: An iterator over visible rows.
Sourcepub fn visible_rows_vec(&self) -> Vec<&DataTableRow<T>>
pub fn visible_rows_vec(&self) -> Vec<&DataTableRow<T>>
Returns visible rows as a vector.
§Returns
Vec<&DataTableRow<T>>: A vector of references to visible rows.
Sourcepub fn get_row(&self, id: &DataTableRowId) -> Option<&DataTableRow<T>>
pub fn get_row(&self, id: &DataTableRowId) -> Option<&DataTableRow<T>>
Sourcepub fn get_row_by_index(&self, index: usize) -> Option<&DataTableRow<T>>
pub fn get_row_by_index(&self, index: usize) -> Option<&DataTableRow<T>>
Sourcepub fn all_row_ids(&self) -> Vec<DataTableRowId>
pub fn all_row_ids(&self) -> Vec<DataTableRowId>
Sourcepub fn filtered_row_ids(&self) -> Vec<DataTableRowId>
pub fn filtered_row_ids(&self) -> Vec<DataTableRowId>
Sourcepub fn visible_row_ids(&self) -> Vec<DataTableRowId>
pub fn visible_row_ids(&self) -> Vec<DataTableRowId>
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Marks the model as needing recomputation.
Source§impl<T> DataTableRowModel<T>where
T: Clone,
impl<T> DataTableRowModel<T>where
T: Clone,
Sourcepub fn set_data<F>(&mut self, data: Vec<T>, id_fn: F)
pub fn set_data<F>(&mut self, data: Vec<T>, id_fn: F)
Updates the data and rebuilds the model.
§Parameters
data: The new raw data rows.id_fn: A function that generates a row ID from row data and index.
Sourcepub fn process(
&mut self,
columns: &[ColumnDef<T>],
filter_state: &FilterState,
sorting_state: &SortingState,
expanding_state: &ExpandingState,
grouping_state: &GroupingState,
pagination_state: &PaginationState,
_selection_state: &RowSelectionState,
)
pub fn process( &mut self, columns: &[ColumnDef<T>], filter_state: &FilterState, sorting_state: &SortingState, expanding_state: &ExpandingState, grouping_state: &GroupingState, pagination_state: &PaginationState, _selection_state: &RowSelectionState, )
Applies the complete row model pipeline.
§Parameters
columns: The column definitions.filter_state: The filtering state.sorting_state: The sorting state.expanding_state: The expanding state.grouping_state: The grouping state.pagination_state: The pagination state._selection_state: The row selection state (reserved for future use).
Trait Implementations§
Source§impl<T> Default for DataTableRowModel<T>
Provides a default empty row model with no data loaded.
impl<T> Default for DataTableRowModel<T>
Provides a default empty row model with no data loaded.
Source§fn default() -> DataTableRowModel<T>
fn default() -> DataTableRowModel<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for DataTableRowModel<T>
impl<T> RefUnwindSafe for DataTableRowModel<T>where
T: RefUnwindSafe,
impl<T> Send for DataTableRowModel<T>where
T: Send,
impl<T> Sync for DataTableRowModel<T>where
T: Sync,
impl<T> Unpin for DataTableRowModel<T>where
T: Unpin,
impl<T> UnsafeUnpin for DataTableRowModel<T>
impl<T> UnwindSafe for DataTableRowModel<T>where
T: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.