Skip to main content

SkillStorageProvider

Trait SkillStorageProvider 

Source
pub trait SkillStorageProvider:
    Send
    + Sync
    + Debug {
    // Required methods
    fn id(&self) -> &str;
    fn name(&self) -> &str;
    fn kind(&self) -> StorageProviderKind;
    fn is_enabled(&self) -> bool;
    fn list_skills<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn refresh<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_skill<'life0, 'life1, 'async_trait>(
        &'life0 self,
        skill: &'life1 Skill,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_skill<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Abstract trait for skill storage/discovery.

Implementations discover skills from different sources. All methods are async to support both I/O-bound and compute-bound providers.

Required Methods§

Source

fn id(&self) -> &str

Unique identifier for this provider instance.

Source

fn name(&self) -> &str

Human-readable name of the provider.

Source

fn kind(&self) -> StorageProviderKind

The kind of storage this provider uses.

Source

fn is_enabled(&self) -> bool

Whether this provider is enabled.

Source

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

List all skills available from this provider.

Source

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

Refresh the skill list (re-scan directories, re-query database, etc.).

Source

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

Save or update a skill in this provider.

Source

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

Delete a skill by ID.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§