pub struct CommandPaletteState {
pub commands: Vec<PaletteCommand>,
pub input: String,
pub cursor: usize,
pub open: bool,
pub last_selected: Option<usize>,
/* private fields */
}Expand description
State for a command palette overlay.
Renders as a modal with a search input and filtered command list.
Fields§
§commands: Vec<PaletteCommand>Available commands.
input: StringCurrent search query.
cursor: usizeCursor index within input.
open: boolWhether the palette modal is open.
last_selected: Option<usize>The last selected command index, set when the user confirms a selection.
Check this after response.changed is true.
Implementations§
Trait Implementations§
Source§impl Clone for CommandPaletteState
impl Clone for CommandPaletteState
Source§fn clone(&self) -> CommandPaletteState
fn clone(&self) -> CommandPaletteState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CommandPaletteState
impl RefUnwindSafe for CommandPaletteState
impl Send for CommandPaletteState
impl Sync for CommandPaletteState
impl Unpin for CommandPaletteState
impl UnsafeUnpin for CommandPaletteState
impl UnwindSafe 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