pub struct PackRegistry;Expand description
Registry of pack factories discovered via inventory at link time.
No instance is needed — all methods are associated functions that walk the
globally-collected PackRegistration slice.
Implementations§
Source§impl PackRegistry
impl PackRegistry
Sourcepub fn discovered_names() -> Vec<&'static str>
pub fn discovered_names() -> Vec<&'static str>
Names of all pack factories discovered via inventory.
Sourcepub fn register_packs(
names: &[String],
runtime: KhiveRuntime,
builder: &mut VerbRegistryBuilder,
) -> Result<(), PackLoadError>
pub fn register_packs( names: &[String], runtime: KhiveRuntime, builder: &mut VerbRegistryBuilder, ) -> Result<(), PackLoadError>
Register the named packs into builder using the supplied runtime.
Validates the explicit pack list against PackFactory::requires() —
if any requested pack declares a dependency that is absent from names,
registration fails (missing dependency is a boot error, not silently
auto-added). Callers must include all required packs explicitly.
The VerbRegistryBuilder::build topo-sort enforces correct load order.
Returns Ok(()) when all names are recognised and all declared
dependencies are satisfied; returns Err(PackLoadError) with a
distinct variant for unknown pack vs missing dependency.
Sourcepub fn register_packs_with_runtimes(
names: &[String],
runtimes: &HashMap<String, KhiveRuntime>,
default_runtime: &KhiveRuntime,
builder: &mut VerbRegistryBuilder,
) -> Result<(), PackLoadError>
pub fn register_packs_with_runtimes( names: &[String], runtimes: &HashMap<String, KhiveRuntime>, default_runtime: &KhiveRuntime, builder: &mut VerbRegistryBuilder, ) -> Result<(), PackLoadError>
Register the named packs into builder, routing each pack to its own runtime.
runtimes maps pack name → KhiveRuntime (one per backend assignment).
default_runtime is used for any pack whose name is not in runtimes.
The validation logic (unknown pack, missing dependency) is identical to
PackRegistry::register_packs.
This is the multi-backend boot path (ADR-028). Single-backend callers
should continue using PackRegistry::register_packs.
Auto Trait Implementations§
impl Freeze for PackRegistry
impl RefUnwindSafe for PackRegistry
impl Send for PackRegistry
impl Sync for PackRegistry
impl Unpin for PackRegistry
impl UnsafeUnpin for PackRegistry
impl UnwindSafe for PackRegistry
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
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>
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>
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 more