pub struct SkillRegistry { /* private fields */ }Expand description
Registry of available skills.
Implementations§
Source§impl SkillRegistry
impl SkillRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a registry pre-loaded with built-in skills.
Sourcepub fn register(&mut self, skill: Skill, source: SkillSource)
pub fn register(&mut self, skill: Skill, source: SkillSource)
Register a skill with a given source.
Sourcepub fn get_registered(&self, name: &str) -> Option<&RegisteredSkill>
pub fn get_registered(&self, name: &str) -> Option<&RegisteredSkill>
Look up a registered skill (with source metadata) by name.
Sourcepub fn list_registered(&self) -> Vec<&RegisteredSkill>
pub fn list_registered(&self) -> Vec<&RegisteredSkill>
List all registered skills with source metadata.
Sourcepub fn remove(&mut self, name: &str) -> Option<Skill>
pub fn remove(&mut self, name: &str) -> Option<Skill>
Remove a skill by name. Returns the removed skill if found.
Sourcepub fn remove_many(&mut self, names: &[&str])
pub fn remove_many(&mut self, names: &[&str])
Remove multiple skills by name.
Sourcepub fn list_by_scope(&self, scope: SkillScope) -> Vec<&Skill>
pub fn list_by_scope(&self, scope: SkillScope) -> Vec<&Skill>
List skills filtered by scope.
Sourcepub fn load_from_dir(&mut self, dir: &Path) -> Result<usize>
pub fn load_from_dir(&mut self, dir: &Path) -> Result<usize>
Load skill definitions from JSON files in a directory.
Each .json file in the directory is deserialized as a Skill and
registered with SkillSource::Project. Skills loaded this way
override any existing skill with the same name. Files are loaded in
sorted order for deterministic behavior.
Returns the number of skills loaded. If the directory does not exist,
returns Ok(0) without error.
Trait Implementations§
Source§impl Clone for SkillRegistry
impl Clone for SkillRegistry
Source§fn clone(&self) -> SkillRegistry
fn clone(&self) -> SkillRegistry
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 SkillRegistry
impl Debug for SkillRegistry
Source§impl Default for SkillRegistry
impl Default for SkillRegistry
Source§fn default() -> SkillRegistry
fn default() -> SkillRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SkillRegistry
impl RefUnwindSafe for SkillRegistry
impl Send for SkillRegistry
impl Sync for SkillRegistry
impl Unpin for SkillRegistry
impl UnsafeUnpin for SkillRegistry
impl UnwindSafe for SkillRegistry
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