pub enum WidgetMutation {
SetValue {
widget_key: String,
value: String,
cursor_byte: Option<i32>,
},
SetChecked {
widget_key: String,
checked: bool,
},
SetSelectedIndex {
widget_key: String,
index: i32,
},
SetItems {
widget_key: String,
items: Vec<TextPropertyEntry>,
item_keys: Vec<String>,
},
SetExpandedKeys {
widget_key: String,
keys: Vec<String>,
},
SetCheckedKeys {
widget_key: String,
checked: bool,
keys: Vec<String>,
},
}Expand description
Targeted in-place mutation of a mounted widget panel — the IPC fast path. Plugins use these when the model change touches one widget; the host applies the mutation directly to the panel’s spec / instance state and re-renders without re-transmitting the full spec.
UpdateWidgetPanel remains the right tool for structural
changes (adding/removing widgets, restructuring layout). Both
paths preserve instance state via widget keys.
Variants§
SetValue
Set a TextInput’s value and (optionally) cursor byte.
Mutates instance state directly.
SetChecked
Set a Toggle’s checked state. Mutates the Toggle’s
checked field in the spec.
SetSelectedIndex
Set a List’s selected index (instance state).
SetItems
Replace a List’s items + parallel item_keys. Mutates
the List in the spec.
SetExpandedKeys
Replace a Tree’s expanded-keys instance state. Plugins use
this when a non-user action needs to drive expansion (e.g.
“expand all”, reveal-on-search). Right/Left arrow keys
and disclosure clicks already mutate expansion host-side
without the plugin’s involvement.
SetCheckedKeys
Set checked to the given value on every node in keys.
Mutates the Tree’s nodes in the spec; the renderer sees
the change on the next paint without a full spec re-emit.
Used by the toggle event handler in plugins to push the
new checkbox state back after a user click or x keypress.
Trait Implementations§
Source§impl Clone for WidgetMutation
impl Clone for WidgetMutation
Source§fn clone(&self) -> WidgetMutation
fn clone(&self) -> WidgetMutation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WidgetMutation
impl Debug for WidgetMutation
Source§impl<'de> Deserialize<'de> for WidgetMutation
impl<'de> Deserialize<'de> for WidgetMutation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for WidgetMutation
impl Serialize for WidgetMutation
Source§impl TS for WidgetMutation
impl TS for WidgetMutation
Source§type WithoutGenerics = WidgetMutation
type WithoutGenerics = WidgetMutation
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = WidgetMutation
type OptionInnerType = WidgetMutation
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read more