Skip to main content

TableEvent

Enum TableEvent 

Source
#[non_exhaustive]
pub enum TableEvent {
Show 13 variants Selection(Vec<usize>), Activate(usize), Sort(Sort), Toggle { row: usize, column: String, value: bool, }, ColumnsChanged, Edit { row: usize, column: String, value: String, }, RowsMoved { rows: Vec<usize>, before: Option<usize>, }, FilesDropped { paths: Vec<PathBuf>, before: Option<usize>, }, UrlsDropped { urls: Vec<String>, before: Option<usize>, }, Paste(String), Key { key: TableKey, rows: Vec<usize>, }, FocusedColumn(Option<String>), IconClicked { row: usize, column: String, },
}
Expand description

Something the user did in the table. Row indices are model indices (positions in the rows given to TableModel::set_rows), whatever the sort.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Selection(Vec<usize>)

The selected rows changed.

§

Activate(usize)

Double-click or Return on a row.

§

Sort(Sort)

The user clicked a column header. With built-in sorting on (the default) the rows are already shown in the new order.

§

Toggle

A checkbox cell was clicked. The model doesn’t change the row: apply it with TableModel::update_row.

Fields

§row: usize

The row (model index).

§column: String

The column id.

§value: bool

The checkbox’s new state.

§

ColumnsChanged

Columns were moved or resized; read TableModel::column_state.

§

Edit

The user finished editing a cell of an Column::editable column. The model doesn’t change the row: apply it with TableModel::update_row.

Fields

§row: usize

The row (model index).

§column: String

The column id.

§value: String

The text the user entered.

§

RowsMoved

The user dragged rows to a new place (see TableModel::set_reorderable). The model doesn’t move them: apply it with TableModel::move_rows.

Fields

§rows: Vec<usize>

The dragged rows (model indices).

§before: Option<usize>

The row they were dropped above (model index), or None for the end.

§

FilesDropped

Files were dropped on the table (see TableModel::set_file_drop).

Fields

§paths: Vec<PathBuf>

The files’ paths.

§before: Option<usize>

The row they were dropped above (model index), or None for the end.

§

UrlsDropped

Web addresses were dropped on the table, dragged from a browser (see TableModel::set_url_drop).

Fields

§urls: Vec<String>

The addresses, as text (https://…).

§before: Option<usize>

The row they were dropped above (model index), or None for the end.

§

Paste(String)

The user pasted (⌘V) text (see TableModel::set_pastes); rows copied from a table arrive as tab-separated lines.

§

Key

The user pressed a bare key the table handles (see TableModel::set_keys) with rows selected.

Fields

§key: TableKey

The key.

§rows: Vec<usize>

The selected rows (model indices).

§

FocusedColumn(Option<String>)

The focused column changed (see TableModel::set_cell_focus): the user clicked a cell in another column, or pressed ← or →.

§

IconClicked

A cell’s icon was clicked (an Column::icon_action column).

Fields

§row: usize

The row (model index).

§column: String

The column id.

Trait Implementations§

Source§

impl Clone for TableEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TableEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TableEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TableEvent

Auto Trait Implementations§

Blanket Implementations§

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> AutoreleaseSafe for T
where T: ?Sized,

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.