pub struct DynamicCommandRegistry { /* private fields */ }Expand description
Dynamic command registry that combines discovered and built-in commands
This registry automatically discovers commands from the filesystem and combines them with built-in commands, providing a unified interface for command validation and metadata application.
Implementations§
Source§impl DynamicCommandRegistry
impl DynamicCommandRegistry
Sourcepub async fn new(commands_dir: Option<PathBuf>) -> Result<Self>
pub async fn new(commands_dir: Option<PathBuf>) -> Result<Self>
Create a new dynamic command registry
§Arguments
commands_dir- Optional path to commands directory (defaults to .claude/commands)
Sourcepub async fn refresh(&mut self) -> Result<()>
pub async fn refresh(&mut self) -> Result<()>
Refresh the command registry by rescanning the filesystem
Sourcepub fn get(&self, name: &str) -> Option<&CommandDefinition>
pub fn get(&self, name: &str) -> Option<&CommandDefinition>
Get a command definition by name
Sourcepub fn validate_command(&self, command: &Command) -> Result<()>
pub fn validate_command(&self, command: &Command) -> Result<()>
Validate a command against its definition
Sourcepub fn apply_defaults(&self, command: &mut Command)
pub fn apply_defaults(&self, command: &mut Command)
Apply default values from command definition
Sourcepub fn list_commands(&self) -> Vec<String>
pub fn list_commands(&self) -> Vec<String>
List all available commands
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicCommandRegistry
impl RefUnwindSafe for DynamicCommandRegistry
impl Send for DynamicCommandRegistry
impl Sync for DynamicCommandRegistry
impl Unpin for DynamicCommandRegistry
impl UnsafeUnpin for DynamicCommandRegistry
impl UnwindSafe for DynamicCommandRegistry
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more