pub struct CommandPaletteState {
pub commands: Vec<SlashCommand>,
pub filter: String,
pub selected: usize,
}Expand description
State for the command palette.
Fields§
§commands: Vec<SlashCommand>§filter: String§selected: usizeImplementations§
Source§impl CommandPaletteState
impl CommandPaletteState
pub fn new(commands: Vec<SlashCommand>) -> Self
pub fn filtered(&self) -> Vec<&SlashCommand>
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn push_filter(&mut self, c: char)
pub fn pop_filter(&mut self)
pub fn selected_command(&self) -> Option<&SlashCommand>
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 (const: unstable) · 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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