pub enum TaskCommand {
SetDataListItems {
widget_id: WidgetId,
items: Vec<String>,
},
SetDataGridRows {
widget_id: WidgetId,
rows: Vec<Vec<String>>,
},
SetText {
widget_id: WidgetId,
text: String,
},
SetValue {
widget_id: WidgetId,
value: i32,
},
SetChecked {
widget_id: WidgetId,
checked: bool,
},
SetEnabled {
widget_id: WidgetId,
enabled: bool,
},
SetVisible {
widget_id: WidgetId,
visible: bool,
},
Progress {
task: TaskId,
value: f64,
},
Finished {
task: TaskId,
},
Failed {
task: TaskId,
message: String,
},
}Expand description
A command posted from a worker thread to the UI thread.
Widget commands mutate a widget exactly like the matching
Ui::set_* call; lifecycle commands produce
crate::UiEvent::Task notifications instead of touching natives.
Variants§
SetDataListItems
Replaces rows in a DataList/ListView widget.
SetDataGridRows
Replaces rows in a DataGrid widget.
SetText
Updates text content for a widget.
SetValue
Sets numeric value for Slider/SpinBox/ProgressBar widgets.
SetChecked
Sets checked state for check-capable widgets.
SetEnabled
Enables or disables a widget.
SetVisible
Shows or hides a widget.
Progress
Reports intermediate progress for a task (0.0–100.0 by convention).
Finished
Reports that a task finished; posted once per task (duplicates are delivered as-is so the UI layer can decide how strict to be).
Failed
Reports that a task failed with a human-readable message.
Implementations§
Source§impl TaskCommand
impl TaskCommand
Sourcepub fn class(&self) -> TaskClass
pub fn class(&self) -> TaskClass
The command’s default channel class (see TaskClass).
Finished and Failed are lossless because the UI state machine
depends on them; every other command is coalescent telemetry by
default (intermediate state publishes that the next sample or the
final commit supersedes).
Sourcepub fn widget_target(&self) -> Option<(WidgetId, TaskCommandKind)>
pub fn widget_target(&self) -> Option<(WidgetId, TaskCommandKind)>
The widget this command mutates, with its kind name; None for
lifecycle commands (Progress/Finished/Failed) that carry no
widget target.