Skip to main content

LiveGridEvent

Enum LiveGridEvent 

Source
#[non_exhaustive]
pub enum LiveGridEvent<K, C> {
Show 14 variants SelectionChange { selection: GridSelection<K>, origin: SelectionOrigin, }, FocusChange { cell: Option<FocusedCell<K, C>>, origin: SelectionOrigin, }, Confirm { keys: Arc<[K]>, secondary: bool, }, Click { target: GridTarget<K, C>, button: MouseButton, modifiers: Modifiers, click_count: usize, }, ProjectionChange { row_count: usize, store_version: u64, }, OrderHeldChange { held: bool, }, LayoutChange { parts: LayoutParts, columns: ColumnSet, origin: LayoutOrigin, }, SortChange { sort: Arc<[(C, SortDirection)]>, origin: SortOrigin, }, GroupChange { origin: GroupOrigin, }, ExpansionChange { target: Option<ExpandTarget<K>>, origin: GroupOrigin, }, EditStart { key: K, column: C, origin: EditOrigin, }, EditCommit { edit: EditId, key: K, column: C, value: OwnedValue, base: OwnedValue, current: OwnedValue, }, EditCancel { key: K, column: C, reason: EditCancelReason, draft: Option<OwnedValue>, }, Drop { source: DropSource<K>, target: DropTarget<K>, modifiers: Modifiers, },
}
Expand description

Events of a LiveGridState: K is the row key, C the column.

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

SelectionChange

The selection changed: at most once per action, before its FocusChange.

Fields

§selection: GridSelection<K>

The whole selection, by key; O(1) to clone. Commands use scoped_selection() instead: this set may hold rows a filter hides.

§origin: SelectionOrigin

Why it changed.

§

FocusChange

The focused cell (the keyboard target) changed: at most once per action, after its SelectionChange.

Fields

§cell: Option<FocusedCell<K, C>>

The new focused cell; None when no row is left to focus.

§origin: SelectionOrigin

Why it changed.

§

Confirm

Enter, Cmd/Ctrl+Enter or a double click on a selected row: the application’s primary command.

Fields

§keys: Arc<[K]>

The scoped selection in display order; never empty.

§secondary: bool

Cmd/Ctrl+Enter: the secondary command.

§

Click

A click: a press and a release of one button on a cell, a pinned cell, a header or the empty area, with no drag between them. Once per click, when the button goes up, after the events the click caused (SelectionChange, FocusChange, SortChange; the Confirm of a double click comes at its second press, before the release).

Not a click: a drag (drag-selection, column move, resize), a press on a resize handle, a press that only closes the context menu, and a press the ContextMenuGesture takes (the menu is its result).

Fields

§target: GridTarget<K, C>

What the press hit, captured when the button went down, by key and column: a re-sort before the release does not retarget it. A row removed from the store (or its band) before the release emits no Click.

§button: MouseButton

The button.

§modifiers: Modifiers

The modifiers held when the button went down.

§click_count: usize

The press’s place in a series: 2 for the second press of a double click.

§

ProjectionChange

A new display order is shown: a rebuild the reorder policy applied (a new sort, filter, quick filter, grouping or data set among them), apply_held_order, a compaction after removals, or the lines laid out again after an ExpansionChange. Once per order shown; not while a newer order is held (OrderHeldChange reports that), and not when only values (aggregates among them), pinned rows or the progress change. A flush that waits for the order resolves after it.

Fields

§row_count: usize

Data rows in the shown order (Projection::row_count): rows of collapsed groups count, pinned rows do not.

§store_version: u64

The version of the store snapshot the shown order was built from.

§

OrderHeldChange

A newer order is ready but held by the ReorderPolicy (held), or the held order was applied (!held). Drive a “refresh order” cue.

Fields

§held: bool

Whether a newer order is waiting.

§

LayoutChange

The column layout changed: once per finished gesture, Action or API call, never while a gesture is in progress. Emitted after the state changed, so a subscriber that reads the grid sees the new layout.

Fields

§parts: LayoutParts

What changed.

§columns: ColumnSet

The columns that changed (every moved column for an order change), by schema index: C::all()[ix.get()] is the column.

§origin: LayoutOrigin

Who changed it.

§

SortChange

The sort changed. Emitted at once, before the rebuild (after an OrderHeldChange { held: false } if a held order was dropped); a ProjectionChange follows when the new order is shown.

Fields

§sort: Arc<[(C, SortDirection)]>

The new sort, most significant column first; empty when unsorted.

§origin: SortOrigin

Why it changed.

§

GroupChange

The grouping or the tree changed: group_by() and tree() read the new one. Emitted at once, before the rebuild (after an OrderHeldChange { held: false } if a held order was dropped, and after the SortChange of the same set_view); a ProjectionChange follows when the new order is shown. A change of the aggregates alone emits nothing: they are values, not the order.

Fields

§origin: GroupOrigin

Who changed it.

§

ExpansionChange

Groups or tree rows were expanded or collapsed. Emitted at once, before the lines are laid out again: is_expanded reads the new state, and a ProjectionChange follows when the lines are shown.

Fields

§target: Option<ExpandTarget<K>>

The one group or tree row toggled (with its descendants, for a deep toggle); None for a new default depth, which clears every toggle (expand all, collapse all, captions only).

§origin: GroupOrigin

Who changed it.

§

EditStart

An editor opened on a cell (not for a commit with no field).

Fields

§key: K

The row.

§column: C

The column.

§origin: EditOrigin

Who started the edit.

§

EditCommit

A value to apply: write it where the rows come from, then answer with LiveGridState::resolve_edit(edit, result). Until then the cell shows value. base is the value the edit started from, current the store’s value at the commit: they differ after a concurrent change (a conflict).

Fields

§edit: EditId

The commit, for resolve_edit.

§key: K

The row.

§column: C

The column.

§value: OwnedValue

The value to apply.

§base: OwnedValue

The cell’s value when the edit started.

§current: OwnedValue

The cell’s value in the store at the commit.

§

EditCancel

An editor closed without a commit.

Fields

§key: K

The row.

§column: C

The column.

§reason: EditCancelReason

Why.

§draft: Option<OwnedValue>

The draft as it parsed, if it did and differs from the value the edit started from: a dropped edit to show or retry.

§

Drop

Rows or an application value were dropped on the rows. Emitted by the grid dropped on, once per drop, after the source grid’s own events of the gesture. The grid changes nothing: the application moves, copies or links data.

Fields

§source: DropSource<K>

What was dropped.

§target: DropTarget<K>

Where it landed.

§modifiers: Modifiers

The modifiers held at the drop; copy or move is the application’s choice (Option on macOS, Ctrl elsewhere usually means copy).

Trait Implementations§

Source§

impl<K: Clone, C: Clone> Clone for LiveGridEvent<K, C>

Source§

fn clone(&self) -> LiveGridEvent<K, C>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, C: Debug> Debug for LiveGridEvent<K, C>

Source§

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

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

impl<D: LiveGridDelegate> EventEmitter<LiveGridEvent<<<D as LiveGridDelegate>::Row as GridRow>::Key, <<D as LiveGridDelegate>::Row as GridRow>::Column>> for LiveGridState<D>

Auto Trait Implementations§

§

impl<K, C> Freeze for LiveGridEvent<K, C>
where K: Freeze, C: Freeze,

§

impl<K, C> !RefUnwindSafe for LiveGridEvent<K, C>

§

impl<K, C> !Send for LiveGridEvent<K, C>

§

impl<K, C> !Sync for LiveGridEvent<K, C>

§

impl<K, C> Unpin for LiveGridEvent<K, C>
where K: Unpin, C: Unpin,

§

impl<K, C> UnsafeUnpin for LiveGridEvent<K, C>
where K: UnsafeUnpin, C: UnsafeUnpin,

§

impl<K, C> !UnwindSafe for LiveGridEvent<K, C>

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

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = 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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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

§

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

§

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