pub struct DataTableCellContext<'a, T> {
pub row: &'a T,
pub row_id: DataTableRowId,
pub row_index: usize,
pub column_id: ColumnId,
pub column_index: usize,
pub is_selected: bool,
pub is_expanded: bool,
pub depth: usize,
}Expand description
Context provided when rendering a cell.
Contains all information needed to render a cell value, including the row data, column information, and table state.
Fields§
§row: &'a TThe row data.
row_id: DataTableRowIdThe row ID.
row_index: usizeThe row index in the current view.
column_id: ColumnIdThe column ID.
column_index: usizeThe column index.
is_selected: boolWhether the row is selected.
is_expanded: boolWhether the row is expanded.
depth: usizeThe depth level for nested rows.
Implementations§
Source§impl<'a, T> DataTableCellContext<'a, T>
impl<'a, T> DataTableCellContext<'a, T>
Sourcepub fn new(
row: &'a T,
row_id: DataTableRowId,
row_index: usize,
column_id: ColumnId,
column_index: usize,
) -> DataTableCellContext<'a, T>
pub fn new( row: &'a T, row_id: DataTableRowId, row_index: usize, column_id: ColumnId, column_index: usize, ) -> DataTableCellContext<'a, T>
Creates a new cell context.
§Parameters
row: The row data reference.row_id: The unique identifier of the row.row_index: The row index in the current view.column_id: The column identifier.column_index: The column index in the current view.
§Returns
DataTableCellContext<'a, T>: A new cell context with default selection, expansion, and depth state.
Sourcepub fn with_selected(self, selected: bool) -> DataTableCellContext<'a, T>
pub fn with_selected(self, selected: bool) -> DataTableCellContext<'a, T>
Sourcepub fn with_expanded(self, expanded: bool) -> DataTableCellContext<'a, T>
pub fn with_expanded(self, expanded: bool) -> DataTableCellContext<'a, T>
Sourcepub fn with_depth(self, depth: usize) -> DataTableCellContext<'a, T>
pub fn with_depth(self, depth: usize) -> DataTableCellContext<'a, T>
Trait Implementations§
Source§impl<'a, T> Clone for DataTableCellContext<'a, T>where
T: Clone,
impl<'a, T> Clone for DataTableCellContext<'a, T>where
T: Clone,
Source§fn clone(&self) -> DataTableCellContext<'a, T>
fn clone(&self) -> DataTableCellContext<'a, 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<'a, T> Freeze for DataTableCellContext<'a, T>
impl<'a, T> RefUnwindSafe for DataTableCellContext<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DataTableCellContext<'a, T>where
T: Sync,
impl<'a, T> Sync for DataTableCellContext<'a, T>where
T: Sync,
impl<'a, T> Unpin for DataTableCellContext<'a, T>
impl<'a, T> UnsafeUnpin for DataTableCellContext<'a, T>
impl<'a, T> UnwindSafe for DataTableCellContext<'a, T>where
T: RefUnwindSafe,
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.