pub struct SlashCommandAutocompleteProvider { /* private fields */ }Expand description
Slash command autocomplete provider.
Implementations§
Source§impl SlashCommandAutocompleteProvider
impl SlashCommandAutocompleteProvider
Sourcepub fn new(commands: Vec<SlashCommand>) -> Self
pub fn new(commands: Vec<SlashCommand>) -> Self
Create a new slash command provider.
Sourcepub fn with_commands(discovered: Vec<SlashCommand>) -> Self
pub fn with_commands(discovered: Vec<SlashCommand>) -> Self
Create with default commands plus a set of dynamically-discovered slash
commands. The discovered commands (e.g. prompt-template names exposed as
/expand-style /-prefixed entries) are appended to the built-in set so
the built-in names win on a fuzzy tie and the discovered names appear as
additional suggestions. Mirrors pi’s behavior where prompt-template
invocations (/<name>) surface alongside built-in slash commands in
/-autocomplete (agent-session.ts:1124 + expandPromptTemplate).
Sourcepub fn with_default_commands() -> Self
pub fn with_default_commands() -> Self
Create with default commands.
Sourcepub fn add_command(&mut self, command: SlashCommand)
pub fn add_command(&mut self, command: SlashCommand)
Add a command.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SlashCommandAutocompleteProvider
impl RefUnwindSafe for SlashCommandAutocompleteProvider
impl Send for SlashCommandAutocompleteProvider
impl Sync for SlashCommandAutocompleteProvider
impl Unpin for SlashCommandAutocompleteProvider
impl UnsafeUnpin for SlashCommandAutocompleteProvider
impl UnwindSafe for SlashCommandAutocompleteProvider
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