pub struct CommandRegistry { /* private fields */ }Expand description
A table of SlashCommand implementations dispatched by name.
Implements CommandRunner so it plugs directly into the existing
Executor orchestration engine.
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
Sourcepub fn new(env: SlenvLoader) -> Self
pub fn new(env: SlenvLoader) -> Self
Create a registry with all builtins and env resolution from dir/.slenv.
Sourcepub fn register(&mut self, cmd: Box<dyn SlashCommand>)
pub fn register(&mut self, cmd: Box<dyn SlashCommand>)
Register a custom command.
Trait Implementations§
Source§impl CommandRunner for CommandRegistry
impl CommandRunner for CommandRegistry
fn run( &self, cmd: &Command, input: Option<&PipeValue>, ) -> Result<CommandOutput, ExecutionError>
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