ChaosPlugin

Trait ChaosPlugin 

Source
pub trait ChaosPlugin: Send + Sync {
    // Required methods
    fn metadata(&self) -> &PluginMetadata;
    fn capabilities(&self) -> Vec<PluginCapability>;
    fn initialize<'life0, 'async_trait>(
        &'life0 mut self,
        config: PluginConfig,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        context: PluginContext,
    ) -> Pin<Box<dyn Future<Output = Result<PluginResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cleanup<'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 validate_config(&self, config: &PluginConfig) -> Result<()> { ... }
    fn config_schema(&self) -> Option<JsonValue> { ... }
}
Expand description

Chaos plugin trait

Required Methods§

Source

fn metadata(&self) -> &PluginMetadata

Get plugin metadata

Source

fn capabilities(&self) -> Vec<PluginCapability>

Get plugin capabilities

Source

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

Initialize plugin with configuration

Source

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

Execute plugin action

Source

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

Cleanup plugin resources

Provided Methods§

Source

fn validate_config(&self, config: &PluginConfig) -> Result<()>

Validate configuration

Source

fn config_schema(&self) -> Option<JsonValue>

Get configuration schema (JSON Schema)

Implementors§