Skip to main content

Pack

Trait Pack 

Source
pub trait Pack {
    const NAME: &'static str;
    const NOTE_KINDS: &'static [&'static str];
    const ENTITY_KINDS: &'static [&'static str];
    const VERBS: &'static [VerbDef];
    const EDGE_RULES: &'static [EdgeEndpointRule] = _;
    const REQUIRES: &'static [&'static str] = _;
}
Expand description

A composable module that contributes vocabulary, verbs, and edge endpoint rules to the khive runtime.

Packs declare what entity kinds, note kinds, and verbs they introduce, and optionally extend the per-relation endpoint contract via EDGE_RULES. The runtime merges vocabularies from all loaded packs and rejects unregistered kinds at the service boundary.

The closed EdgeRelation enum (ADR-021) is not extensible — only its per-relation endpoint contract is (ADR-031).

Required Associated Constants§

Source

const NAME: &'static str

Short identifier for this pack (e.g. “kg”, “tasks”).

Source

const NOTE_KINDS: &'static [&'static str]

Note kinds this pack contributes to the runtime vocabulary.

Source

const ENTITY_KINDS: &'static [&'static str]

Entity kinds this pack contributes to the runtime vocabulary.

Source

const VERBS: &'static [VerbDef]

Verbs this pack handles. The runtime routes verb calls to the pack that declares them.

Provided Associated Constants§

Source

const EDGE_RULES: &'static [EdgeEndpointRule] = _

Additional edge endpoint rules this pack contributes (ADR-031).

Defaults to empty — packs that introduce no new endpoint pairs (or only rely on the ADR-002 base contract) can ignore this.

Source

const REQUIRES: &'static [&'static str] = _

Other pack names whose vocabulary this pack references (ADR-037).

The runtime checks that every name in REQUIRES appears in the loaded pack set before any pack is registered. Defaults to empty so existing packs compile without changes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§