Module dependency_injection

Source
Expand description

Dependency injection module. This module provides tools to initialize and share resources and services amongst different threads.

It takes all its inputs from the configuration which should combine inputs from:

  • environment
  • command line
  • configuration files
  • default values

The Builder ensure every services has required dependencies to build and provide services containers for each sub process.

Macros§

get_dependency
Retrieve attribute stored in the builder. If not yet initialized, we instantiate it by calling the associated build function (build_<attribute_name>). If we don’t want to to use the default build function, we can pass an expression that build the value. Usage examples: get_dependency!(self.signer_registerer) get_dependency!(self.signer_registerer = self.build_signer_registerer().await?)

Structs§

DatabaseCommandDependenciesContainer
Dependencies container for the database commands
DependenciesBuilder
Dependencies container builder
GenesisCommandDependenciesContainer
Dependencies container for the genesis commands
ServeCommandDependenciesContainer
Dependencies container for the serve command
ToolsCommandDependenciesContainer
Dependencies container for the tools commands

Enums§

DependenciesBuilderError
Error that can occur during dependencies initialization process.

Type Aliases§

EpochServiceWrapper
EpochServiceWrapper wraps
Result
Result with the DependenciesBuilderError error.