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§
Sourcefn kind(&self) -> StorageProviderKind
fn kind(&self) -> StorageProviderKind
The kind of storage this provider uses.
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Whether this provider is enabled.
Sourcefn 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 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.
Sourcefn 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 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.).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".