pub struct DataTableRow<T> {
pub id: DataTableRowId,
pub original: T,
pub original_index: usize,
pub view_index: usize,
pub depth: usize,
pub parent_id: Option<DataTableRowId>,
pub sub_row_ids: Vec<DataTableRowId>,
pub is_group_row: bool,
pub group_value: Option<String>,
pub can_expand: bool,
pub can_select: bool,
}Expand description
A row in the table with associated metadata.
Wraps the original data and adds metadata for table operations like selection, expansion, grouping, and nested row support.
Fields§
§id: DataTableRowIdUnique identifier for the row.
original: TThe original row data.
original_index: usizeIndex in the original data array.
view_index: usizeIndex in the current view (after filtering/sorting).
depth: usizeDepth level for nested/grouped rows.
parent_id: Option<DataTableRowId>Parent row ID for nested rows.
sub_row_ids: Vec<DataTableRowId>Child row IDs for expandable rows.
is_group_row: boolWhether this is a group row (aggregated).
group_value: Option<String>Group value for grouped rows.
can_expand: boolWhether this row can be expanded.
can_select: boolWhether this row can be selected.
Implementations§
Source§impl<T> DataTableRow<T>
impl<T> DataTableRow<T>
Sourcepub fn new(
id: impl Into<DataTableRowId>,
original: T,
original_index: usize,
) -> DataTableRow<T>
pub fn new( id: impl Into<DataTableRowId>, original: T, original_index: usize, ) -> DataTableRow<T>
Sourcepub fn from_index(original: T, index: usize) -> DataTableRow<T>
pub fn from_index(original: T, index: usize) -> DataTableRow<T>
Sourcepub fn with_view_index(self, index: usize) -> DataTableRow<T>
pub fn with_view_index(self, index: usize) -> DataTableRow<T>
Sourcepub fn with_depth(self, depth: usize) -> DataTableRow<T>
pub fn with_depth(self, depth: usize) -> DataTableRow<T>
Sourcepub fn with_parent(self, parent_id: DataTableRowId) -> DataTableRow<T>
pub fn with_parent(self, parent_id: DataTableRowId) -> DataTableRow<T>
Sourcepub fn with_sub_rows(self, sub_row_ids: Vec<DataTableRowId>) -> DataTableRow<T>
pub fn with_sub_rows(self, sub_row_ids: Vec<DataTableRowId>) -> DataTableRow<T>
Sourcepub fn as_group_row(self, group_value: String) -> DataTableRow<T>
pub fn as_group_row(self, group_value: String) -> DataTableRow<T>
Sourcepub fn with_can_select(self, can_select: bool) -> DataTableRow<T>
pub fn with_can_select(self, can_select: bool) -> DataTableRow<T>
Sourcepub fn data_mut(&mut self) -> &mut T
pub fn data_mut(&mut self) -> &mut T
Returns a mutable reference to the original data.
§Returns
&mut T: A mutable reference to the original row data.
Sourcepub fn has_sub_rows(&self) -> bool
pub fn has_sub_rows(&self) -> bool
Source§impl<T> DataTableRow<T>where
T: Clone,
impl<T> DataTableRow<T>where
T: Clone,
Sourcepub fn clone_with_view_index(&self, view_index: usize) -> DataTableRow<T>
pub fn clone_with_view_index(&self, view_index: usize) -> DataTableRow<T>
Trait Implementations§
Source§impl<T> Clone for DataTableRow<T>where
T: Clone,
impl<T> Clone for DataTableRow<T>where
T: Clone,
Source§fn clone(&self) -> DataTableRow<T>
fn clone(&self) -> DataTableRow<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for DataTableRow<T>where
T: Freeze,
impl<T> RefUnwindSafe for DataTableRow<T>where
T: RefUnwindSafe,
impl<T> Send for DataTableRow<T>where
T: Send,
impl<T> Sync for DataTableRow<T>where
T: Sync,
impl<T> Unpin for DataTableRow<T>where
T: Unpin,
impl<T> UnsafeUnpin for DataTableRow<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for DataTableRow<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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.