Skip to main content

Table

Struct Table 

Source
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

Source

pub fn new(title: impl Into<String>, columns: Vec<String>) -> Self

Source

pub fn push_row(&mut self, row: Vec<String>)

Source

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.

Source

pub fn select_row(&mut self, i: usize)

Toggle a row’s selection (headless-test + click handler entry point).

Source

pub fn clear_selection(&mut self)

Clear the row selection.

Source

pub fn selected_rows(&self) -> Vec<usize>

The currently-selected row indices, in order.

Source§

impl Table

Source

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

Source§

fn copy_kinds(&self) -> &[ClipKind]

The kinds this source can offer, richest first.
Source§

fn copy_payload(&self) -> Option<ClipPayload>

Produce the payload for the current selection (richest representation).
Source§

impl Facet for Table

Source§

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>

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.)

Source§

fn title(&self) -> &str

Source§

fn ui(&mut self, ui: &mut Ui)

Source§

fn state_json(&self) -> Value

Source§

fn caps(&self) -> FacetCaps

What this facet can do. Override to opt into capabilities.
Source§

fn scale(&self) -> f32

Current uniform scale (1.0 = native). Override if caps().scalable.
Source§

fn set_scale(&mut self, scale: f32)

Set the uniform scale; clamp internally. Default no-op (not scalable).
Source§

fn selection_json(&self) -> Value

The current selection as JSON (also folded into state_json by convention). Null when nothing/none selectable.
Source§

fn kind(&self) -> &'static str

Stable component-type id (e.g. "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

Adopt a portable state produced by portable_state on a same-kind sibling. Returns true if accepted. Default false (opt-in per component).
Source§

fn cut(&mut self) -> Option<String>

Like copy, but also removes the selection. Default delegates to copy.
Source§

fn paste(&mut self, _text: &str) -> bool

Accept pasted text. Returns true if consumed.
Source§

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> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.