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 with_row_ids(self, ids: Vec<RowId>) -> Self
pub fn with_row_ids(self, ids: Vec<RowId>) -> Self
Attach stable row identities (FC-5), one per row, in row order. When
set, the a11y node label + identity key derive from the RowId instead of
the visual position, so re-ordering / inserting / deleting rows keeps each
row’s identity stable. Back-compatible: leave unset to key on the index.
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.
Source§impl Table
impl Table
Sourcepub fn copy_tsv(&self) -> Option<String>
pub fn copy_tsv(&self) -> Option<String>
TSV of the selected rows (or all rows when none selected), header first —
shared by Facet::copy and CopySource. None for an empty table.
Trait Implementations§
Source§impl CopySource for Table
impl CopySource for Table
Source§fn copy_kinds(&self) -> &[ClipKind]
fn copy_kinds(&self) -> &[ClipKind]
Source§fn copy_payload(&self) -> Option<ClipPayload>
fn copy_payload(&self) -> Option<ClipPayload>
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.
Source§fn portable_state(&self) -> Option<Value>
fn portable_state(&self) -> Option<Value>
The portable arrangement: the column order (the header sequence), the row selection, and the uniform scale. (The row data belongs to each table’s own source; this clones how the table is arranged/selected so a sibling over the same shape mirrors it.)
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)
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
state_json by
convention). Null when nothing/none selectable.Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
"jobview", "graphpan", "table"). Two
instances with the same kind can exchange portable state; the empty
default "" means opted out of cross-instance clone.Source§fn load_state(&mut self, state: &Value) -> bool
fn load_state(&mut self, state: &Value) -> bool
portable_state
on a same-kind sibling. Returns true if accepted. Default false
(opt-in per component).Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
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)>
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§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more