pub struct MarketplaceRegistry { /* private fields */ }Expand description
Manages marketplace sources and provides plugin discovery across them.
Implementations§
Source§impl MarketplaceRegistry
impl MarketplaceRegistry
Sourcepub fn new(cache_root: impl Into<PathBuf>) -> Self
pub fn new(cache_root: impl Into<PathBuf>) -> Self
Create a new marketplace registry. Cache goes under cache_root/marketplaces/.
Sourcepub fn add(&mut self, source: MarketplaceSource) -> Result<String, PluginError>
pub fn add(&mut self, source: MarketplaceSource) -> Result<String, PluginError>
Add a marketplace source. For local/inline sources, this is immediate.
For remote sources (GitHub, git, URL, npm), fetching happens in
refresh().
Returns the marketplace name.
Sourcepub fn remove(&mut self, name: &str) -> Result<(), PluginError>
pub fn remove(&mut self, name: &str) -> Result<(), PluginError>
Remove a marketplace and its cached data.
Sourcepub fn get(&self, name: &str) -> Option<&Marketplace>
pub fn get(&self, name: &str) -> Option<&Marketplace>
Get the marketplace manifest by name.
Sourcepub fn search(&self, query: &str) -> Vec<(&Marketplace, &MarketplaceEntry)>
pub fn search(&self, query: &str) -> Vec<(&Marketplace, &MarketplaceEntry)>
Search across all marketplaces for plugins matching query
(case-insensitive substring match on name and description).
Sourcepub fn list_all(&self) -> Vec<(&Marketplace, &MarketplaceEntry)>
pub fn list_all(&self) -> Vec<(&Marketplace, &MarketplaceEntry)>
List all available plugins across all marketplaces.
Sourcepub fn save(&self) -> Result<(), PluginError>
pub fn save(&self) -> Result<(), PluginError>
Save known marketplaces metadata to known_marketplaces.json.
Sourcepub fn load(&mut self) -> Result<(), PluginError>
pub fn load(&mut self) -> Result<(), PluginError>
Load known marketplaces from known_marketplaces.json.
Auto Trait Implementations§
impl Freeze for MarketplaceRegistry
impl RefUnwindSafe for MarketplaceRegistry
impl Send for MarketplaceRegistry
impl Sync for MarketplaceRegistry
impl Unpin for MarketplaceRegistry
impl UnsafeUnpin for MarketplaceRegistry
impl UnwindSafe for MarketplaceRegistry
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