pub struct CommandPalette { /* private fields */ }Implementations§
Source§impl CommandPalette
impl CommandPalette
pub fn new(items: Vec<SharedString>, cx: &mut Context<'_, Self>) -> Self
Sourcepub fn focus(&self, window: &mut Window, cx: &mut App)
pub fn focus(&self, window: &mut Window, cx: &mut App)
Focus the query field — call after mounting, or the palette swallows keys without showing a caret.
pub fn query_text(&self, cx: &App) -> SharedString
Sourcepub fn active_item(&self) -> Option<usize>
pub fn active_item(&self) -> Option<usize>
The item the user would get by confirming right now.
Trait Implementations§
impl EventEmitter<PaletteEvent> for CommandPalette
Source§impl Focusable for CommandPalette
impl Focusable for CommandPalette
Source§fn focus_handle(&self, _: &App) -> FocusHandle
fn focus_handle(&self, _: &App) -> FocusHandle
The field holds focus; the palette is the context around it.
Source§impl Render for CommandPalette
impl Render for CommandPalette
Auto Trait Implementations§
impl !RefUnwindSafe for CommandPalette
impl !UnwindSafe for CommandPalette
impl Freeze for CommandPalette
impl Send for CommandPalette
impl Sync for CommandPalette
impl Unpin for CommandPalette
impl UnsafeUnpin for CommandPalette
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more