pub struct SlashCommand {
pub name: String,
pub description: Option<String>,
pub argument_hint: Option<String>,
pub argument_completions: Option<Vec<AutocompleteItem>>,
pub get_argument_completions: Option<Arc<dyn Fn(&str) -> Vec<AutocompleteItem> + Send + Sync>>,
}Expand description
A slash command definition.
Fields§
§name: String§description: Option<String>§argument_hint: Option<String>§argument_completions: Option<Vec<AutocompleteItem>>Static argument completions (pi-compat: getArgumentCompletions).
When set, these are filtered by the typed prefix and shown.
When None and get_argument_completions is also None, file completion is used.
get_argument_completions: Option<Arc<dyn Fn(&str) -> Vec<AutocompleteItem> + Send + Sync>>Dynamic argument completions callback (pi-style getArgumentCompletions).
Called with the typed argument prefix, returns matching items.
Takes precedence over argument_completions when set.
Trait Implementations§
Source§impl Clone for SlashCommand
impl Clone for SlashCommand
Source§fn clone(&self) -> SlashCommand
fn clone(&self) -> SlashCommand
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 !RefUnwindSafe for SlashCommand
impl !UnwindSafe for SlashCommand
impl Freeze for SlashCommand
impl Send for SlashCommand
impl Sync for SlashCommand
impl Unpin for SlashCommand
impl UnsafeUnpin for SlashCommand
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