pub struct CommandRegistry { /* private fields */ }Expand description
Registry for managing custom commands
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
Sourcepub fn register(&mut self, command: CommandDefinition) -> Result<()>
pub fn register(&mut self, command: CommandDefinition) -> Result<()>
Register a command
Sourcepub fn unregister(&mut self, command_id: &str) -> Result<()>
pub fn unregister(&mut self, command_id: &str) -> Result<()>
Unregister a command
Sourcepub fn get(&self, command_id: &str) -> Result<CommandDefinition>
pub fn get(&self, command_id: &str) -> Result<CommandDefinition>
Get a command by ID
Sourcepub fn list_all(&self) -> Vec<CommandDefinition>
pub fn list_all(&self) -> Vec<CommandDefinition>
Get all commands
Sourcepub fn list_enabled(&self) -> Vec<CommandDefinition>
pub fn list_enabled(&self) -> Vec<CommandDefinition>
Get all enabled commands
Sourcepub fn find_by_tag(&self, tag: &str) -> Vec<CommandDefinition>
pub fn find_by_tag(&self, tag: &str) -> Vec<CommandDefinition>
Get commands by tag
Sourcepub fn search(&self, query: &str) -> Vec<CommandDefinition>
pub fn search(&self, query: &str) -> Vec<CommandDefinition>
Search commands by name or description
Trait Implementations§
Source§impl Clone for CommandRegistry
impl Clone for CommandRegistry
Source§fn clone(&self) -> CommandRegistry
fn clone(&self) -> CommandRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandRegistry
impl Debug for CommandRegistry
Auto Trait Implementations§
impl Freeze for CommandRegistry
impl RefUnwindSafe for CommandRegistry
impl Send for CommandRegistry
impl Sync for CommandRegistry
impl Unpin 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