Skip to main content

ModuleTrait

Trait ModuleTrait 

Source
pub trait ModuleTrait: Send + Sync {
    // Required methods
    fn name(&self) -> String;
    fn version(&self) -> i32;
    fn default_arc() -> Arc<dyn ModuleTrait> 
       where Self: Sized;

    // Provided methods
    fn should_login(&self) -> bool { ... }
    fn headers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Headers> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn cookies<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Cookies> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn dag_definition<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Option<ModuleDagDefinition>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn add_step<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<Arc<dyn ModuleNodeTrait>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn pre_process<'life0, 'async_trait>(
        &'life0 self,
        _config: Option<Arc<ModuleConfig>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn post_process<'life0, 'async_trait>(
        &'life0 self,
        _config: Option<Arc<ModuleConfig>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn cron(&self) -> Option<CronConfig> { ... }
}

Required Methods§

Source

fn name(&self) -> String

Source

fn version(&self) -> i32

Source

fn default_arc() -> Arc<dyn ModuleTrait>
where Self: Sized,

Provided Methods§

Source

fn should_login(&self) -> bool

Source

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

Source

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

Source

fn dag_definition<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ModuleDagDefinition>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Optional custom DAG definition built from ModuleNodeTrait nodes.

  • Some(definition): use custom DAG path.
  • None: fallback to legacy add_step linear-compat DAG.
Source

fn add_step<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<Arc<dyn ModuleNodeTrait>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn pre_process<'life0, 'async_trait>( &'life0 self, _config: Option<Arc<ModuleConfig>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn post_process<'life0, 'async_trait>( &'life0 self, _config: Option<Arc<ModuleConfig>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn cron(&self) -> Option<CronConfig>

Returns cron schedule config for this module. Defaults to None (scheduled startup disabled).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§