pub struct PackIr {
pub manifest: PackManifest,
pub markdown: Vec<MarkdownDoc>,
pub adapters: Vec<AdapterDef>,
pub policies: Vec<PolicyDef>,
pub injections: Vec<InjectionDef>,
pub providers: Vec<ProviderDef>,
pub memories: Vec<MemoryDef>,
pub intents: Vec<IntentDef>,
pub flows: Vec<FlowDefinition>,
}Fields§
§manifest: PackManifest§markdown: Vec<MarkdownDoc>§adapters: Vec<AdapterDef>§policies: Vec<PolicyDef>§injections: Vec<InjectionDef>§providers: Vec<ProviderDef>§memories: Vec<MemoryDef>§intents: Vec<IntentDef>§flows: Vec<FlowDefinition>Implementations§
Source§impl PackIr
impl PackIr
Sourcepub fn new(
manifest: PackManifest,
markdown: Vec<MarkdownDoc>,
) -> Result<Self, PackError>
pub fn new( manifest: PackManifest, markdown: Vec<MarkdownDoc>, ) -> Result<Self, PackError>
Constructs a PackIr by validating the provided manifest, extracting configurations from Markdown fence blocks, checking for duplicates, and merging TOML- and Markdown-derived definitions into a single intermediate representation.
This performs the following high-level steps:
- Validates profiles, toolsets, agents, injections, and routing declared in the manifest.
- Builds adapters, policies, injections, and providers from the TOML manifest.
- Extracts adapters, policies, injections, and providers from Markdown fence blocks.
- Checks for duplicates within Markdown and across TOML vs Markdown (adapters, policies, providers, and injections). Duplicate definitions cause a validation error.
- Merges Markdown-derived definitions into the TOML-derived lists and returns the merged IR.
§Returns
Ok(Self) containing the manifest, the original Markdown documents, and the merged lists of
adapters, policies, injections, and providers on success; Err(PackError) if validation,
TOML parsing, or Markdown extraction fails.
§Examples
ⓘ
// Construct a PackIr from a manifest and any Markdown docs.
// (The concrete construction of `manifest` and `markdown` depends on your crate's API.)
let manifest = build_manifest();
let markdown = load_markdown();
let pack_ir = PackIr::new(manifest, markdown).expect("manifest and markdown must be valid");Trait Implementations§
Auto Trait Implementations§
impl Freeze for PackIr
impl RefUnwindSafe for PackIr
impl Send for PackIr
impl Sync for PackIr
impl Unpin for PackIr
impl UnwindSafe for PackIr
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