Skip to main content

RuntimeFactorsBuilder

Trait RuntimeFactorsBuilder 

Source
pub trait RuntimeFactorsBuilder {
    type Factors: RuntimeFactors;
    type CliArgs: Args;
    type RuntimeConfig: Into<<Self::Factors as RuntimeFactors>::RuntimeConfig>;

    // Required method
    fn build(
        config: &FactorsConfig,
        args: &Self::CliArgs,
    ) -> Result<(Self::Factors, Self::RuntimeConfig)>;

    // Provided method
    fn configure_app<U: Send + 'static>(
        executor: &mut FactorsExecutor<Self::Factors, U>,
        runtime_config: &Self::RuntimeConfig,
        config: &FactorsConfig,
        args: &Self::CliArgs,
    ) -> Result<()> { ... }
}
Expand description

A builder for runtime factors.

Required Associated Types§

Source

type Factors: RuntimeFactors

The factors type to build.

Source

type CliArgs: Args

CLI arguments not included in FactorsConfig needed to build the [RuntimeFactors].

Source

type RuntimeConfig: Into<<Self::Factors as RuntimeFactors>::RuntimeConfig>

The wrapped runtime config type.

Required Methods§

Source

fn build( config: &FactorsConfig, args: &Self::CliArgs, ) -> Result<(Self::Factors, Self::RuntimeConfig)>

Build the factors and runtime config from the given options.

Provided Methods§

Source

fn configure_app<U: Send + 'static>( executor: &mut FactorsExecutor<Self::Factors, U>, runtime_config: &Self::RuntimeConfig, config: &FactorsConfig, args: &Self::CliArgs, ) -> Result<()>

Configure the factors in the executor.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§