pub struct PluginMarketplace { /* private fields */ }Expand description
A local plugin marketplace registry.
In production this would talk to a remote API. For now it is an in-memory
catalog used for testing, development, and the CLI plugins command.
Implementations§
Source§impl PluginMarketplace
impl PluginMarketplace
pub fn new() -> Self
Sourcepub fn publish(&self, metadata: PluginMetadata) -> Result<(), String>
pub fn publish(&self, metadata: PluginMetadata) -> Result<(), String>
Register a plugin in the marketplace.
Returns Err if the name is empty, version is empty, or a plugin with
the same name is already published.
Sourcepub fn search(&self, query: &str) -> Vec<PluginMetadata>
pub fn search(&self, query: &str) -> Vec<PluginMetadata>
Search plugins by query string.
Matches against name, description, and tags (case-insensitive).
Sourcepub fn by_category(&self, category: PluginCategory) -> Vec<PluginMetadata>
pub fn by_category(&self, category: PluginCategory) -> Vec<PluginMetadata>
List plugins by category.
Sourcepub fn get(&self, name: &str) -> Option<PluginMetadata>
pub fn get(&self, name: &str) -> Option<PluginMetadata>
Get a specific plugin by name.
Sourcepub fn list_all(&self) -> Vec<PluginMetadata>
pub fn list_all(&self) -> Vec<PluginMetadata>
List all available plugins.
Sourcepub fn unpublish(&self, name: &str) -> bool
pub fn unpublish(&self, name: &str) -> bool
Remove a plugin from the marketplace. Returns true if it existed.
Sourcepub fn seed_builtins(&self)
pub fn seed_builtins(&self)
Seed the marketplace with all built-in plugin metadata.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PluginMarketplace
impl RefUnwindSafe for PluginMarketplace
impl Send for PluginMarketplace
impl Sync for PluginMarketplace
impl Unpin for PluginMarketplace
impl UnsafeUnpin for PluginMarketplace
impl UnwindSafe for PluginMarketplace
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