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.