pub struct CommandRegistry { /* private fields */ }Expand description
Vec-backed slash-command registry.
Stores built-in CommandSpec entries (static) plus Goal-169
skill-backed commands loaded from .recursive/skills/.
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
Sourcepub fn default_set() -> Self
pub fn default_set() -> Self
Build the default registry — the built-in commands.
Sourcepub fn with_skill_commands(self, skills: Vec<SkillCommand>) -> Self
pub fn with_skill_commands(self, skills: Vec<SkillCommand>) -> Self
Goal-169: register skill-backed commands alongside built-ins.
Skill commands appear in lookup and search results. A skill command whose name collides with a built-in is silently shadowed by the built-in (built-ins win).
Sourcepub fn skill_commands(&self) -> &[SkillCommand]
pub fn skill_commands(&self) -> &[SkillCommand]
Return a reference to the loaded skill commands.
Sourcepub fn commands(&self) -> &[CommandSpec]
pub fn commands(&self) -> &[CommandSpec]
Read-only access to the registered commands. Used by the help modal and by tests.
Sourcepub fn lookup(&self, name: &str) -> Option<&CommandSpec>
pub fn lookup(&self, name: &str) -> Option<&CommandSpec>
Look up a built-in command by canonical name or alias. The leading
/ is not part of name — strip it before calling.
Sourcepub fn lookup_skill(&self, name: &str) -> Option<&SkillCommand>
pub fn lookup_skill(&self, name: &str) -> Option<&SkillCommand>
Look up a skill command by canonical name or alias.
Built-ins shadow skill commands: if a built-in with the same name
exists, this returns None (callers should check lookup first).
Sourcepub fn search(&self, prefix: &str) -> Vec<&CommandSpec>
pub fn search(&self, prefix: &str) -> Vec<&CommandSpec>
Prefix-match across canonical names and aliases for built-in commands.
Returns commands whose name (or any alias) starts with prefix,
sorted alphabetically by canonical name. An empty prefix
returns all commands.
Sourcepub fn search_skills(&self, prefix: &str) -> Vec<&SkillCommand>
pub fn search_skills(&self, prefix: &str) -> Vec<&SkillCommand>
Prefix-match across all skill commands.
Trait Implementations§
Source§impl Clone for CommandRegistry
impl Clone for CommandRegistry
Source§fn clone(&self) -> CommandRegistry
fn clone(&self) -> CommandRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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