pub struct RuntimeComponentRegistry { /* private fields */ }Expand description
Registry for runtime component metadata and lifecycle hooks.
Implementations§
Source§impl RuntimeComponentRegistry
impl RuntimeComponentRegistry
Sourcepub fn configured<F>(configure: F) -> Selfwhere
F: FnOnce(&mut Self),
pub fn configured<F>(configure: F) -> Selfwhere
F: FnOnce(&mut Self),
Creates a registry and applies one product or subsystem registration function.
Sourcepub fn configure<F>(&mut self, configure: F) -> &mut Selfwhere
F: FnOnce(&mut Self),
pub fn configure<F>(&mut self, configure: F) -> &mut Selfwhere
F: FnOnce(&mut Self),
Applies a product or subsystem registration function.
Sourcepub fn register_bundle<B>(&mut self, bundle: B) -> &mut Selfwhere
B: RuntimeComponentBundle,
pub fn register_bundle<B>(&mut self, bundle: B) -> &mut Selfwhere
B: RuntimeComponentBundle,
Registers one product-owned component bundle.
Sourcepub fn component_health_with_options<F, Fut>(
&mut self,
component_name: &'static str,
kind: RuntimeComponentKind,
check_name: &'static str,
options: HealthCheckOptions,
check: F,
) -> &mut Self
pub fn component_health_with_options<F, Fut>( &mut self, component_name: &'static str, kind: RuntimeComponentKind, check_name: &'static str, options: HealthCheckOptions, check: F, ) -> &mut Self
Registers a component health check with explicit options.
Sourcepub fn component_startup<F, Fut>(
&mut self,
component_name: &'static str,
kind: RuntimeComponentKind,
phase_name: &'static str,
failure_policy: StartupPhaseFailurePolicy,
phase: F,
) -> &mut Self
pub fn component_startup<F, Fut>( &mut self, component_name: &'static str, kind: RuntimeComponentKind, phase_name: &'static str, failure_policy: StartupPhaseFailurePolicy, phase: F, ) -> &mut Self
Registers a component startup phase.
Sourcepub fn component_task(
&mut self,
component_name: &'static str,
kind: RuntimeComponentKind,
task_name: &'static str,
display_name: &'static str,
) -> &mut Self
pub fn component_task( &mut self, component_name: &'static str, kind: RuntimeComponentKind, task_name: &'static str, display_name: &'static str, ) -> &mut Self
Registers a component-owned runtime task descriptor.
Sourcepub fn component_shutdown<F, Fut>(
&mut self,
component_name: &'static str,
kind: RuntimeComponentKind,
phase_name: &'static str,
timeout: Option<Duration>,
phase: F,
) -> &mut Self
pub fn component_shutdown<F, Fut>( &mut self, component_name: &'static str, kind: RuntimeComponentKind, phase_name: &'static str, timeout: Option<Duration>, phase: F, ) -> &mut Self
Registers a component shutdown phase.
Sourcepub fn component_shutdown_once<T, F, Fut>(
&mut self,
component_name: &'static str,
kind: RuntimeComponentKind,
phase_name: &'static str,
timeout: Option<Duration>,
value: T,
phase: F,
) -> &mut Self
pub fn component_shutdown_once<T, F, Fut>( &mut self, component_name: &'static str, kind: RuntimeComponentKind, phase_name: &'static str, timeout: Option<Duration>, value: T, phase: F, ) -> &mut Self
Registers a component shutdown phase that consumes one owned value at most once.
Sourcepub fn component(&mut self, name: &'static str) -> RuntimeComponentBuilder<'_>
pub fn component(&mut self, name: &'static str) -> RuntimeComponentBuilder<'_>
Returns a builder for name, creating the component when needed.
Sourcepub fn descriptors(&self) -> &[RuntimeComponentDescriptor]
pub fn descriptors(&self) -> &[RuntimeComponentDescriptor]
Returns registered component descriptors in registration order.
Sourcepub fn descriptor(&self, name: &str) -> Option<&RuntimeComponentDescriptor>
pub fn descriptor(&self, name: &str) -> Option<&RuntimeComponentDescriptor>
Returns one descriptor by component name.
Sourcepub const fn health_registry(&self) -> &HealthCheckRegistry
pub const fn health_registry(&self) -> &HealthCheckRegistry
Returns the underlying health registry.
Sourcepub const fn health_registry_mut(&mut self) -> &mut HealthCheckRegistry
pub const fn health_registry_mut(&mut self) -> &mut HealthCheckRegistry
Returns the underlying health registry mutably.
Sourcepub async fn run_health(
&mut self,
scope: HealthCheckScope,
) -> SystemHealthReport
pub async fn run_health( &mut self, scope: HealthCheckScope, ) -> SystemHealthReport
Runs health checks registered for scope.
Sourcepub async fn startup(&mut self) -> StartupReport
pub async fn startup(&mut self) -> StartupReport
Runs registered startup phases.
Sourcepub fn validate(&self) -> Result<(), RuntimeComponentGraphError>
pub fn validate(&self) -> Result<(), RuntimeComponentGraphError>
Validates that the component dependency graph is resolvable.
Sourcepub async fn shutdown(&mut self) -> ShutdownReport
pub async fn shutdown(&mut self) -> ShutdownReport
Runs registered shutdown phases in component dependency order.
A component’s dependencies run before that component when both sides have shutdown phases. Multiple phases registered by one component run in registration order. Dependencies without shutdown phases are kept as descriptor metadata and do not block execution. Cycles are reported as warnings and the registry still makes best-effort progress without executing a phase more than once.