pub struct StandardPlugin { /* private fields */ }
Expand description
Standard plugin implementation for single-tool plugins
This is a convenience implementation for plugins that provide a single tool. It handles the boilerplate of implementing VxPlugin for simple cases.
Implementations§
Source§impl StandardPlugin
impl StandardPlugin
Sourcepub fn new<F>(
name: impl Into<String>,
description: impl Into<String>,
version: impl Into<String>,
tool_factory: F,
) -> Self
pub fn new<F>( name: impl Into<String>, description: impl Into<String>, version: impl Into<String>, tool_factory: F, ) -> Self
Create a new standard plugin
§Arguments
name
- Plugin namedescription
- Plugin descriptionversion
- Plugin versiontool_factory
- Factory function that creates the tool instance
Set the plugin author
Sourcepub fn with_homepage(self, homepage: impl Into<String>) -> Self
pub fn with_homepage(self, homepage: impl Into<String>) -> Self
Set the plugin homepage
Trait Implementations§
Source§impl VxPlugin for StandardPlugin
impl VxPlugin for StandardPlugin
Source§fn description(&self) -> &str
fn description(&self) -> &str
Plugin description (optional) Read more
Plugin author (optional) Read more
Source§fn package_managers(&self) -> Vec<Box<dyn VxPackageManager>>
fn package_managers(&self) -> Vec<Box<dyn VxPackageManager>>
Get all package managers provided by this plugin Read more
Source§fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the plugin (optional) Read more
Source§fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shutdown the plugin (optional) Read more
Source§fn supports_tool(&self, tool_name: &str) -> bool
fn supports_tool(&self, tool_name: &str) -> bool
Check if this plugin supports a specific tool Read more
Source§fn supports_package_manager(&self, pm_name: &str) -> bool
fn supports_package_manager(&self, pm_name: &str) -> bool
Check if this plugin supports a specific package manager Read more
Source§fn get_tool(&self, tool_name: &str) -> Option<Box<dyn VxTool>>
fn get_tool(&self, tool_name: &str) -> Option<Box<dyn VxTool>>
Get a specific tool by name Read more
Source§fn get_package_manager(
&self,
pm_name: &str,
) -> Option<Box<dyn VxPackageManager>>
fn get_package_manager( &self, pm_name: &str, ) -> Option<Box<dyn VxPackageManager>>
Get a specific package manager by name Read more
Source§fn is_compatible_with(&self, vx_version: &str) -> bool
fn is_compatible_with(&self, vx_version: &str) -> bool
Check plugin compatibility with the current vx version Read more
Auto Trait Implementations§
impl Freeze for StandardPlugin
impl !RefUnwindSafe for StandardPlugin
impl Send for StandardPlugin
impl Sync for StandardPlugin
impl Unpin for StandardPlugin
impl !UnwindSafe for StandardPlugin
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