Skip to main content

SkillSource

Trait SkillSource 

Source
pub trait SkillSource: Send + Sync {
    // Required methods
    fn search(
        &self,
        query: &str,
        cursor: Option<&str>,
    ) -> Result<SkillSearchPage>;
    fn versions(&self, skill_id: &str) -> Result<Vec<SkillVersion>>;
    fn download(
        &self,
        skill_id: &str,
        version: &str,
    ) -> Result<Box<dyn Read + Send>>;
}
Expand description

A blocking catalog adapter. A desktop caller runs these calls off the UI thread.

An adapter owns its transport and credentials. IDs, versions and cursors must be passed to the provider as data. They are not local paths.

Required Methods§

Source

fn search(&self, query: &str, cursor: Option<&str>) -> Result<SkillSearchPage>

Search the provider and return one bounded page.

Source

fn versions(&self, skill_id: &str) -> Result<Vec<SkillVersion>>

List the available versions for a provider-specific skill ID.

Source

fn download( &self, skill_id: &str, version: &str, ) -> Result<Box<dyn Read + Send>>

Stream the ZIP for exactly the requested version, even when newer versions exist.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§