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 new() -> BundleRegistry
pub fn new() -> BundleRegistry
Empty registry.
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 Forget for BundleRegistry
impl Freeze for BundleRegistry
impl Move 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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.