#[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
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: SelectionOriginWhy 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: SelectionOriginWhy it changed.
Confirm
Enter, Cmd/Ctrl+Enter or a double click on a selected row: the application’s primary command.
Fields
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.
The button.
modifiers: ModifiersThe modifiers held when the button went down.
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
OrderHeldChange
A newer order is ready but held by the ReorderPolicy (held), or
the held order was applied (!held). Drive a “refresh order” cue.
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: LayoutPartsWhat changed.
columns: ColumnSetThe columns that changed (every moved column for an order change),
by schema index: C::all()[ix.get()] is the column.
origin: LayoutOriginWho 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: SortOriginWhy 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: GroupOriginWho 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: GroupOriginWho changed it.
EditStart
An editor opened on a cell (not for a commit with no field).
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
key: KThe row.
column: CThe column.
value: OwnedValueThe value to apply.
base: OwnedValueThe cell’s value when the edit started.
current: OwnedValueThe cell’s value in the store at the commit.
EditCancel
An editor closed without a commit.
Fields
key: KThe row.
column: CThe column.
reason: EditCancelReasonWhy.
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: ModifiersThe 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>
impl<K: Clone, C: Clone> Clone for LiveGridEvent<K, C>
Source§fn clone(&self) -> LiveGridEvent<K, C>
fn clone(&self) -> LiveGridEvent<K, C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<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>
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>
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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