pub struct SourcesManager { /* private fields */ }Expand description
Sources manager for handling multiple sources
Implementations§
Source§impl SourcesManager
impl SourcesManager
Sourcepub fn with_cache_ttl(config_path: PathBuf, cache_ttl_seconds: u64) -> Self
pub fn with_cache_ttl(config_path: PathBuf, cache_ttl_seconds: u64) -> Self
Create a new sources manager with custom cache TTL
Sourcepub fn load(&mut self) -> Result<(), SourcesError>
pub fn load(&mut self) -> Result<(), SourcesError>
Load sources from TOML file
Sourcepub fn save(&self) -> Result<(), SourcesError>
pub fn save(&self) -> Result<(), SourcesError>
Save sources to TOML file
Sourcepub fn add_source(
&mut self,
name: String,
config: SourceConfig,
) -> Result<(), SourcesError>
pub fn add_source( &mut self, name: String, config: SourceConfig, ) -> Result<(), SourcesError>
Add a new source
Sourcepub fn add_source_with_priority(
&mut self,
name: String,
config: SourceConfig,
priority: u32,
) -> Result<(), SourcesError>
pub fn add_source_with_priority( &mut self, name: String, config: SourceConfig, priority: u32, ) -> Result<(), SourcesError>
Add a new source with priority
Sourcepub fn remove_source(&mut self, name: &str) -> Result<(), SourcesError>
pub fn remove_source(&mut self, name: &str) -> Result<(), SourcesError>
Remove a source
Sourcepub fn get_source(&self, name: &str) -> Option<&SourceDefinition>
pub fn get_source(&self, name: &str) -> Option<&SourceDefinition>
Get a source by name
Sourcepub fn list_sources(&self) -> Vec<&SourceDefinition>
pub fn list_sources(&self) -> Vec<&SourceDefinition>
List all sources (sorted by priority)
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear the marketplace cache
Sourcepub async fn get_available_skills(&self) -> Result<Vec<SkillInfo>, SourcesError>
pub async fn get_available_skills(&self) -> Result<Vec<SkillInfo>, SourcesError>
Get available skills from all sources (checked in priority order)
Sourcepub async fn get_skills_from_source(
&self,
source_name: &str,
source_def: &SourceDefinition,
) -> Result<Vec<SkillInfo>, SourcesError>
pub async fn get_skills_from_source( &self, source_name: &str, source_def: &SourceDefinition, ) -> Result<Vec<SkillInfo>, SourcesError>
Get skills from a specific source
Sourcepub async fn get_marketplace_json(
&self,
source_name: &str,
) -> Result<MarketplaceJson, SourcesError>
pub async fn get_marketplace_json( &self, source_name: &str, ) -> Result<MarketplaceJson, SourcesError>
Get marketplace.json for a specific source Tries Claude Code standard location (.claude-plugin/marketplace.json) first, then root (marketplace.json)
Auto Trait Implementations§
impl Freeze for SourcesManager
impl !RefUnwindSafe for SourcesManager
impl Send for SourcesManager
impl Sync for SourcesManager
impl Unpin for SourcesManager
impl UnsafeUnpin for SourcesManager
impl !UnwindSafe for SourcesManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.