pub enum ToolbarPatch {
Focus {
item: String,
},
Text {
item: String,
text: String,
},
On {
item: String,
on: bool,
},
Selected {
item: String,
index: usize,
},
Enabled {
item: String,
on: bool,
},
Suggestions {
item: String,
list: Vec<String>,
},
Label {
item: String,
label: String,
tooltip: Option<String>,
},
Placeholder {
item: String,
text: String,
},
}Expand description
A targeted update to one live toolbar item: the path that keeps a bound signal in sync without rebuilding the bar (which would drop the search field’s focus mid-keystroke).
Variants§
Focus
Focus a search control and select its text without changing its value.
Text
Replace a search item’s text.
On
Set a toggle item’s state.
Selected
Select a segmented item’s index.
Enabled
Enable or disable any item.
Suggestions
Replace a search item’s completions (docs/search.md). Targeted rather than a rebuild, because these change on every keystroke and rebuilding the bar would take the field’s focus with it.
Label
Replace an item’s words (a language change): its label, which an icon-only item still carries for the overflow menu and assistive technology, and its tooltip. The item keeps its native widget, its action and its place.
Placeholder
Replace a search item’s empty-state prompt (docs/search.md), in the live field.
Implementations§
Source§impl ToolbarPatch
impl ToolbarPatch
Trait Implementations§
Source§impl Clone for ToolbarPatch
impl Clone for ToolbarPatch
Source§fn clone(&self) -> ToolbarPatch
fn clone(&self) -> ToolbarPatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more