pub struct Table {
pub title: String,
pub columns: Vec<String>,
pub rows: Vec<Vec<String>>,
/* private fields */
}Expand description
A data table: header columns + rows (each a row of cells).
Fields§
§title: String§columns: Vec<String>§rows: Vec<Vec<String>>Implementations§
Source§impl Table
impl Table
pub fn new(title: impl Into<String>, columns: Vec<String>) -> Self
pub fn push_row(&mut self, row: Vec<String>)
Sourcepub fn select_row(&mut self, i: usize)
pub fn select_row(&mut self, i: usize)
Toggle a row’s selection (headless-test + click handler entry point).
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear the row selection.
Sourcepub fn selected_rows(&self) -> Vec<usize>
pub fn selected_rows(&self) -> Vec<usize>
The currently-selected row indices, in order.
Trait Implementations§
Source§impl Facet for Table
impl Facet for Table
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
TSV: header row + selected rows (or all rows when none selected),
\t-joined cells, \n between rows. None only for an empty table.
fn title(&self) -> &str
fn ui(&mut self, ui: &mut Ui)
fn state_json(&self) -> Value
Source§fn set_scale(&mut self, scale: f32)
fn set_scale(&mut self, scale: f32)
Set the uniform scale; clamp internally. Default no-op (not scalable).
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
The current selection as JSON (also folded into
state_json by
convention). Null when nothing/none selectable.Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
Like
copy, but also removes the selection. Default delegates to copy.Source§fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
Optional downcast handle for hosts that need typed access to a specific
facet living inside a
FacetDeck (e.g. a robot-UI driver clicking an
app-level control that must forward to a concrete component’s own API).
Defaulted to None so no existing facet has to change; a component opts in
by returning Some(self).Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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