pub struct BundleRegistry { /* private fields */ }Expand description
Holds bundles until the kernel compiles them.
Registration order is preserved when there are no dependencies; otherwise
Self::sorted returns a topologically sorted list (dependencies first).
Implementations§
Source§impl BundleRegistry
impl BundleRegistry
Sourcepub fn register(
&mut self,
bundle: impl BundleInterface + 'static,
) -> Result<(), KernelError>
pub fn register( &mut self, bundle: impl BundleInterface + 'static, ) -> Result<(), KernelError>
Registers a bundle. Names must be unique.
§Errors
Returns KernelError::DuplicateBundle when bundle.name() is already present.
Sourcepub fn names(&self) -> Vec<&'static str>
pub fn names(&self) -> Vec<&'static str>
Registered names in registration order (before sorting).
Sourcepub fn sorted(self) -> Result<Vec<Box<dyn BundleInterface>>, KernelError>
pub fn sorted(self) -> Result<Vec<Box<dyn BundleInterface>>, KernelError>
Returns bundles in dependency order (dependencies before dependents).
Among ready nodes, lower registration index wins (stable).
§Errors
KernelError::UnknownBundleDependencywhen a dependency was never registered.KernelError::CyclicBundleDependencywhen the graph has a cycle.
§Panics
Panics if a sorted index does not map to a registered bundle (internal invariant).
Trait Implementations§
Source§impl Default for BundleRegistry
impl Default for BundleRegistry
Source§fn default() -> BundleRegistry
fn default() -> BundleRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for BundleRegistry
impl !UnwindSafe for BundleRegistry
impl Freeze for BundleRegistry
impl Send for BundleRegistry
impl Sync for BundleRegistry
impl Unpin for BundleRegistry
impl UnsafeUnpin for BundleRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more