pub struct CommandPaletteState {
pub is_open: Signal<bool>,
pub query: Signal<String>,
pub selected_index: Signal<usize>,
pub actions: Vec<CommandAction>,
}Expand description
Reactive state coordinator for the Command Palette.
Fields§
§is_open: Signal<bool>§query: Signal<String>§selected_index: Signal<usize>§actions: Vec<CommandAction>Implementations§
Source§impl CommandPaletteState
impl CommandPaletteState
pub fn new(actions: Vec<CommandAction>) -> Self
Sourcepub fn filtered_actions(&self) -> Vec<CommandAction>
pub fn filtered_actions(&self) -> Vec<CommandAction>
Returns filtered actions based on active query string.
Sourcepub fn select_next(&self)
pub fn select_next(&self)
Advances the selected item down.
Sourcepub fn select_prev(&self)
pub fn select_prev(&self)
Advances the selected item up.
Sourcepub fn execute_selected(&self)
pub fn execute_selected(&self)
Executes the currently highlighted action.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CommandPaletteState
impl !Send for CommandPaletteState
impl !Sync for CommandPaletteState
impl !UnwindSafe for CommandPaletteState
impl Freeze for CommandPaletteState
impl Unpin for CommandPaletteState
impl UnsafeUnpin for CommandPaletteState
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
Mutably borrows from an owned value. Read more