Struct fiberplane_models::notebooks::TableCell
source · #[non_exhaustive]pub struct TableCell {
pub id: String,
pub read_only: Option<bool>,
pub column_defs: Vec<TableColumnDefinition>,
pub rows: Vec<TableRow>,
}Expand description
Cell used for displaying tables in a notebook.
Tables have columns, which are tracked using TableColumnDefinition. The column definition may specify a specific schema to be used for all values in that column.
Tables also have rows, which are used for tracking all the data in the table. Each row has multiple “row values” (we intentionally avoid the term “cell” here, because it would be too confusing with the table cell itself).
Row values have a specific data type, which should correspond to the type specified in the TableColumnDefinition.
Every row and every column inside a table has a unique ID. Those IDs can be
combined to create a TableRowValueId. TableRowValueId can be serialized
to be used inside the field of
some operations
as well as focus types.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: String§read_only: Option<bool>§column_defs: Vec<TableColumnDefinition>Describes the types used for the columns and the order they should be rendered in.
rows: Vec<TableRow>Holds the table rows and their values.
Implementations§
source§impl TableCell
impl TableCell
sourcepub fn builder() -> TableCellBuilder<((), (), (), ())>
pub fn builder() -> TableCellBuilder<((), (), (), ())>
Create a builder for building TableCell.
On the builder, call .id(...), .read_only(...)(optional), .column_defs(...)(optional), .rows(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TableCell.
source§impl TableCell
impl TableCell
sourcepub fn column_def(&self, id: &TableColumnId) -> Option<&TableColumnDefinition>
pub fn column_def(&self, id: &TableColumnId) -> Option<&TableColumnDefinition>
Returns a reference to a column definition by TableColumnId.
sourcepub fn row(&self, id: &TableRowId) -> Option<&TableRow>
pub fn row(&self, id: &TableRowId) -> Option<&TableRow>
Returns a reference to a row by TableRowId.
sourcepub fn row_value(&self, id: &TableRowValueId) -> Option<&TableRowValue>
pub fn row_value(&self, id: &TableRowValueId) -> Option<&TableRowValue>
Returns a reference to a row value.
sourcepub fn with_row_value(&self, field: &str, updated_value: TableRowValue) -> Self
pub fn with_row_value(&self, field: &str, updated_value: TableRowValue) -> Self
Returns the table cell with an updated row value for the given field.