pub struct Nidus;Expand description
Framework bootstrap entrypoint.
Implementations§
Source§impl Nidus
impl Nidus
Sourcepub fn bootstrap<M: Module>() -> Result<Application>
pub fn bootstrap<M: Module>() -> Result<Application>
Bootstraps a Nidus application from a root module definition.
The module graph is validated and the container is populated with the root
module graph’s typed providers. Synchronous providers are registered here;
providers that require async initialization are not run by this synchronous
entrypoint and need Nidus::bootstrap_with_lifecycle (or the facade
builder) to construct.
Sourcepub fn bootstrap_with_modules<M, I>(modules: I) -> Result<Application>
pub fn bootstrap_with_modules<M, I>(modules: I) -> Result<Application>
Bootstraps a Nidus application from a root module and explicit graph definitions.
Like Nidus::bootstrap, this validates the graph and registers synchronous
typed providers. Async provider initializers are not run by this synchronous
entrypoint.
Sourcepub async fn bootstrap_with_lifecycle<M: Module>(
lifecycle: LifecycleRunner,
) -> Result<Application>
pub async fn bootstrap_with_lifecycle<M: Module>( lifecycle: LifecycleRunner, ) -> Result<Application>
Bootstraps a Nidus application and runs startup lifecycle hooks.
Typed providers are registered and async provider initializers run before startup hooks, so hooks can resolve fully initialized providers.
Sourcepub async fn bootstrap_with_modules_and_lifecycle<M, I>(
modules: I,
lifecycle: LifecycleRunner,
) -> Result<Application>
pub async fn bootstrap_with_modules_and_lifecycle<M, I>( modules: I, lifecycle: LifecycleRunner, ) -> Result<Application>
Bootstraps a Nidus application from an explicit module graph and runs startup hooks.
Typed providers are registered and async provider initializers run before startup hooks, so hooks can resolve fully initialized providers.