pub trait BundleInterface: Send + Sync {
// Required method
fn name(&self) -> &'static str;
// Provided methods
fn dependencies(&self) -> &'static [&'static str] { ... }
fn build(&self) -> Result<(), KernelError> { ... }
fn boot(&self) -> Result<(), KernelError> { ... }
fn shutdown(&self) -> Result<(), KernelError> { ... }
}Expand description
Composition unit registered on a Kernel.
Bundles declare Self::dependencies; the kernel topologically sorts them
before build / boot so dependents run after their dependencies.
Default implementations are no-ops so an empty bundle is valid.
BundleInterface is the Symfony-shaped name; Bundle is the same trait.
Required Methods§
Provided Methods§
Sourcefn dependencies(&self) -> &'static [&'static str]
fn dependencies(&self) -> &'static [&'static str]
Bundle names that must compile and boot before this one.
Empty by default. Unknown names and cycles fail at crate::Kernel::compile.
Sourcefn build(&self) -> Result<(), KernelError>
fn build(&self) -> Result<(), KernelError>
Compile-time wiring (register services on the DI container).
§Errors
Return KernelError when the bundle cannot be compiled.
Sourcefn boot(&self) -> Result<(), KernelError>
fn boot(&self) -> Result<(), KernelError>
Runtime warmup after the kernel has compiled.
§Errors
Return KernelError when the bundle cannot start.
Sourcefn shutdown(&self) -> Result<(), KernelError>
fn shutdown(&self) -> Result<(), KernelError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".