Skip to main content

build_container

Function build_container 

Source
pub fn build_container(
    packages_dir: Option<&Path>,
    environment: &str,
    extensions: &[&dyn Extension],
) -> Result<(Config, Container), BundleError>
Expand description

Loads config/packages (plus {environment}/ overlay), runs extensions, and compiles.

Flattened package parameters are applied first. The merged root config is registered as CONFIG_SERVICE. Each extension then receives config.section(extension.alias()). Event and console compile passes always run so tagged subscribers and commands populate their services.

Call serenade_config::load_dotenv on the project root before this when apps use .env files.

ยงErrors

Returns BundleError on config, extension, or DI failures.