pub struct CommandRegistry { /* private fields */ }Expand description
Global command registry
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
Sourcepub fn global() -> &'static CommandRegistry
pub fn global() -> &'static CommandRegistry
Get global command registry instance
Sourcepub fn register(&self, command: PluginCommand)
pub fn register(&self, command: PluginCommand)
Register a command
Sourcepub fn register_with_handler(
&self,
command: PluginCommand,
handler: CommandHandler,
)
pub fn register_with_handler( &self, command: PluginCommand, handler: CommandHandler, )
Register a command with a custom handler
Sourcepub fn get(&self, name: &str) -> Option<ExecutablePluginCommand>
pub fn get(&self, name: &str) -> Option<ExecutablePluginCommand>
Get a command by name
Sourcepub fn all_commands(&self) -> Vec<String>
pub fn all_commands(&self) -> Vec<String>
Get all registered command names
Sourcepub fn get_by_plugin(&self, plugin_name: &str) -> Vec<ExecutablePluginCommand>
pub fn get_by_plugin(&self, plugin_name: &str) -> Vec<ExecutablePluginCommand>
Get commands for a specific plugin
Sourcepub fn parse_slash_command(
input: &str,
) -> Option<(String, String, HashMap<String, String>)>
pub fn parse_slash_command( input: &str, ) -> Option<(String, String, HashMap<String, String>)>
Parse a slash command and extract plugin name, command name, and arguments Format: /plugin-name:command arg1=value1 arg2=value2
Sourcepub fn execute_slash_command(
&self,
input: &str,
context: &CommandContext,
) -> Result<CommandResult, AgentError>
pub fn execute_slash_command( &self, input: &str, context: &CommandContext, ) -> Result<CommandResult, AgentError>
Execute a slash command
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CommandRegistry
impl RefUnwindSafe for CommandRegistry
impl Send for CommandRegistry
impl Sync for CommandRegistry
impl Unpin for CommandRegistry
impl UnsafeUnpin for CommandRegistry
impl UnwindSafe for CommandRegistry
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