pub trait PackFactory:
Send
+ Sync
+ 'static {
// Required methods
fn name(&self) -> &'static str;
fn create(&self, runtime: KhiveRuntime) -> Box<dyn PackRuntime>;
// Provided methods
fn requires(&self) -> &'static [&'static str] { ... }
fn intentionally_verbless(&self) -> bool { ... }
fn create_install(&self, runtime: KhiveRuntime) -> PackInstall { ... }
fn create_resolver(
&self,
_runtime: KhiveRuntime,
) -> Option<Box<dyn PackByIdResolver>> { ... }
}Required Methods§
Sourcefn create(&self, runtime: KhiveRuntime) -> Box<dyn PackRuntime>
fn create(&self, runtime: KhiveRuntime) -> Box<dyn PackRuntime>
Create a new pack instance for the given runtime.
Provided Methods§
Sourcefn requires(&self) -> &'static [&'static str]
fn requires(&self) -> &'static [&'static str]
Names of packs that must be loaded before this one.
Defaults to empty so pack crates that have no dependencies compile
without changes. PackRegistry::register_packs validates that every
name listed here is present in the caller’s explicit pack list — absent
dependencies are a boot error, not silently auto-added.
Sourcefn intentionally_verbless(&self) -> bool
fn intentionally_verbless(&self) -> bool
Whether this pack intentionally exposes no top-level MCP verbs.
Defaults to false so a declared pack whose runtime contributes no
Visibility::Verb handlers fails at registration instead of silently
disappearing from the served surface. Vocabulary- or ontology-only
packs must opt in explicitly.
Sourcefn create_install(&self, runtime: KhiveRuntime) -> PackInstall
fn create_install(&self, runtime: KhiveRuntime) -> PackInstall
Build the full installation bundle for this pack: runtime, optional resolver, optional dispatch hook.
Defaults to composing create and create_resolver with no dispatch
hook, so existing factories compile unchanged. Packs whose dispatch
hook must observe the same instance as the runtime (e.g. brain)
override this method instead of create, since the default would
otherwise require two independent instances to share state.
Sourcefn create_resolver(
&self,
_runtime: KhiveRuntime,
) -> Option<Box<dyn PackByIdResolver>>
fn create_resolver( &self, _runtime: KhiveRuntime, ) -> Option<Box<dyn PackByIdResolver>>
Optionally create a PackByIdResolver for this pack.
Packs that own private SQL tables implement this to hook into
get(id) and delete(id). Defaults to None so existing packs
compile without changes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".