Skip to main content

Module

Trait Module 

Source
pub trait Module: Send + Sync {
    // Required method
    fn run<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ModuleResult, ModuleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn options_json(&self) -> Value { ... }
    fn dry_run<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ModuleResult, ModuleError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn set_option(
        &mut self,
        _name: &str,
        _value: &str,
    ) -> Result<(), ModuleError> { ... }
    fn validate(&self) -> Result<(), ModuleError> { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn options_json(&self) -> Value

Source

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

Preview the module’s output without side effects (no network I/O). Used by the executor to enforce DenyPayload rules pre-execution.

Source

fn set_option(&mut self, _name: &str, _value: &str) -> Result<(), ModuleError>

Source

fn validate(&self) -> Result<(), ModuleError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§