pub struct DefaultPluginManager { /* private fields */ }Expand description
Default plugin manager implementation
Implementations§
Source§impl DefaultPluginManager
impl DefaultPluginManager
Sourcepub fn new(config: PluginConfig) -> Result<Self>
pub fn new(config: PluginConfig) -> Result<Self>
Create a new plugin manager
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize and auto-load plugins
Sourcepub async fn load_plugins_from_directory(&self, dir: &Path) -> Result<()>
pub async fn load_plugins_from_directory(&self, dir: &Path) -> Result<()>
Load all plugins from a directory
Trait Implementations§
Source§impl PluginManagerTrait for DefaultPluginManager
impl PluginManagerTrait for DefaultPluginManager
Source§fn load_plugin<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<PluginId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_plugin<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<PluginId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load plugin from file
Source§fn unload_plugin<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unload_plugin<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unload a plugin
Source§fn get_plugin<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
) -> Pin<Box<dyn Future<Output = Result<PluginInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_plugin<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
) -> Pin<Box<dyn Future<Output = Result<PluginInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get plugin info
Source§fn list_plugins<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PluginInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_plugins<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PluginInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all plugins
Source§fn scan_all<'life0, 'life1, 'async_trait>(
&'life0 self,
context: ScanContext<'life1>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<PluginId, Vec<Threat>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn scan_all<'life0, 'life1, 'async_trait>(
&'life0 self,
context: ScanContext<'life1>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<PluginId, Vec<Threat>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Scan with all plugins
Source§fn scan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
context: ScanContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Threat>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn scan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
context: ScanContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Threat>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Scan with specific plugin
Source§fn get_health<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_health<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PluginId,
) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get plugin health status
Auto Trait Implementations§
impl Freeze for DefaultPluginManager
impl !RefUnwindSafe for DefaultPluginManager
impl Send for DefaultPluginManager
impl Sync for DefaultPluginManager
impl Unpin for DefaultPluginManager
impl !UnwindSafe for DefaultPluginManager
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 more