Skip to main content

SystemChange

Enum SystemChange 

Source
pub enum SystemChange {
Show 28 variants TextSelectionClick { position: LogicalPosition, timestamp: Instant, }, TextSelectionDrag { start_position: LogicalPosition, current_position: LogicalPosition, }, ApplySelectionOp { target: DomNodeId, op: SelectionOp, }, CopyToClipboard, CutToClipboard { target: DomNodeId, }, PasteFromClipboard, SelectAllText, UndoTextEdit { target: DomNodeId, }, RedoTextEdit { target: DomNodeId, }, AddCursorAtClick { position: LogicalPosition, }, SelectNextOccurrence { target: DomNodeId, }, ApplyPendingTextInput, ApplyTextChangeset, ActivateNodeDrag { dom_id: DomId, node_id: NodeId, }, ActivateWindowDrag, InitDragVisualState, SetDragOverState { target: DomNodeId, active: bool, }, UpdateDropTarget { target: DomNodeId, }, UpdateDragGpuTransform, DeactivateDrag, SetFocus { new_focus: Option<DomNodeId>, old_focus: Option<DomNodeId>, }, ClearAllSelections, FinalizePendingFocusChanges, ScrollSelectionIntoView, ScrollNodeIntoView { target: DomNodeId, }, ScrollCursorIntoViewAfterTextInput, StartAutoScrollTimer, StopAutoScrollTimer,
}
Expand description

Framework-determined side effects (system changes).

Unlike CallbackChange (from user callbacks), these are determined by the framework’s event analysis: hit tests, gesture detection, focus rules, text selection, keyboard shortcuts, etc.

Both CallbackChange (user) and SystemChange (framework) are processed through exhaustive match on PlatformWindowV2 — adding a new variant causes a compile error in apply_system_change().

Variants§

§

TextSelectionClick

Process a mouse click for text selection (single/double/triple click).

Fields

§timestamp: Instant
§

TextSelectionDrag

Extend text selection via mouse drag.

Fields

§start_position: LogicalPosition
§current_position: LogicalPosition
§

ApplySelectionOp

Unified selection operation: cursor movement, selection extension, or deletion.

Replaces the old ArrowKeyNavigation and DeleteTextSelection variants. Every keyboard shortcut maps to a single SelectionOp — see its docs.

Fields

§target: DomNodeId
§

CopyToClipboard

Copy selected text to system clipboard (Ctrl+C / Cmd+C).

§

CutToClipboard

Cut selected text to clipboard and delete (Ctrl+X / Cmd+X).

Fields

§target: DomNodeId
§

PasteFromClipboard

Paste text from system clipboard at cursor (Ctrl+V / Cmd+V).

§

SelectAllText

Select all text in focused node (Ctrl+A / Cmd+A).

§

UndoTextEdit

Undo last text edit (Ctrl+Z / Cmd+Z).

Fields

§target: DomNodeId
§

RedoTextEdit

Redo last undone edit (Ctrl+Y / Ctrl+Shift+Z / Cmd+Shift+Z).

Fields

§target: DomNodeId
§

AddCursorAtClick

Add a cursor at the clicked position (Ctrl+Click). The position will be hit-tested to find the text cursor location.

Fields

§

SelectNextOccurrence

Select the next occurrence of the current selection’s text (Ctrl+D). If the primary selection is a cursor, expand it to the word first.

Fields

§target: DomNodeId
§

ApplyPendingTextInput

Apply pending text input from platform (keyboard/IME).

§

ApplyTextChangeset

Apply text changeset (incremental relayout).

§

ActivateNodeDrag

Activate node drag on a draggable element.

Fields

§dom_id: DomId
§node_id: NodeId
§

ActivateWindowDrag

Activate window drag (CSD titlebar).

§

InitDragVisualState

Set up drag visual state (:dragging pseudo-state, GPU transform key, DragDropManager sync).

§

SetDragOverState

Set :drag-over pseudo-state on a target node.

Fields

§target: DomNodeId
§active: bool
§

UpdateDropTarget

Update current drop target in drag context.

Fields

§target: DomNodeId
§

UpdateDragGpuTransform

Update GPU transform for active node drag.

§

DeactivateDrag

End drag: clear pseudo-states, remove GPU keys, end drag session.

§

SetFocus

Change focus to a new target (or clear focus if None). Handles: set_focused_node, apply_focus_restyle, scroll_node_into_view, cursor_blink_timer start/stop.

Fields

§new_focus: Option<DomNodeId>
§old_focus: Option<DomNodeId>
§

ClearAllSelections

Clear all text selections.

§

FinalizePendingFocusChanges

Finalize pending focus changes (cursor initialization after layout).

§

ScrollSelectionIntoView

Scroll cursor/selection into view.

§

ScrollNodeIntoView

Scroll a specific node into view.

Fields

§target: DomNodeId
§

ScrollCursorIntoViewAfterTextInput

Scroll cursor into view after text input (needs relayout first).

§

StartAutoScrollTimer

Start auto-scroll timer for drag-to-scroll (60Hz).

§

StopAutoScrollTimer

Cancel auto-scroll timer.

Trait Implementations§

Source§

impl Clone for SystemChange

Source§

fn clone(&self) -> SystemChange

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 SystemChange

Source§

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

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

impl FromIterator<SystemChange> for SystemChangeVec

Source§

fn from_iter<T>(iter: T) -> Self
where T: IntoIterator<Item = SystemChange>,

Creates a value from an iterator. Read more
Source§

impl PartialEq for SystemChange

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SystemChange

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