Skip to main content

SkillSource

Trait SkillSource 

Source
pub trait SkillSource: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SkillSummary>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Skill>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A pluggable backend that can enumerate and load skills.

Implementations must be cheap to list — the CLI calls list on every invocation of devboy skills list. load is allowed to be heavier (opening files, issuing network calls) because it is only called on explicit install / show.

Required Methods§

Source

fn name(&self) -> &'static str

Short identifier for this source (“embedded”, “marketplace”, …). Used in error messages and in devboy skills list --source ….

Source

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SkillSummary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all skills known to this source. Order is source-defined; callers should sort if they need a deterministic display.

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Skill>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the full Skill (frontmatter + body) for the named skill.

Returns crate::error::SkillError::NotFound if the source does not know about name.

Implementors§