Skip to main content

SecurityPlugin

Trait SecurityPlugin 

Source
pub trait SecurityPlugin: Send + Sync {
    // Required methods
    fn metadata(&self) -> PluginMetadata;
    fn initialize<'life0, 'async_trait>(
        &'life0 mut self,
        config: Value,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn scan<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: ScanContext<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Threat>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + 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;

    // Provided methods
    fn update_config<'life0, 'async_trait>(
        &'life0 mut self,
        config: Value,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn get_metrics(&self) -> PluginMetrics { ... }
}
Expand description

Security plugin trait

Required Methods§

Source

fn metadata(&self) -> PluginMetadata

Get plugin metadata

Source

fn initialize<'life0, 'async_trait>( &'life0 mut self, config: Value, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize plugin with configuration

Source

fn scan<'life0, 'life1, 'async_trait>( &'life0 self, context: ScanContext<'life1>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Threat>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Scan data for threats

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HealthStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform health check

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,

Shutdown plugin

Provided Methods§

Source

fn update_config<'life0, 'async_trait>( &'life0 mut self, config: Value, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update plugin configuration

Source

fn get_metrics(&self) -> PluginMetrics

Get current metrics

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§