Skip to main content

load_bundle

Function load_bundle 

Source
pub fn load_bundle(
    source: &dyn BundleSource,
) -> Result<WorkbookBundle, BundleLoadError>
Expand description

Re-export of the full boot surface (D-11) so Shape A/B consumers register a served workbook WITHOUT ever naming pmcp-workbook-runtime: the BundleSource trait + its on-disk impl, the fail-closed loader entry point, and both error types. The EmbeddedSource impl is re-exported separately under the workbook-embedded feature (it needs the runtime’s embedded include_dir support). Load + fail-closed integrity-verify a bundle from any BundleSource.

This is the SINGLE shared verifier (WBSV-08): a local-dir bundle and an embedded bundle are checked identically. Returns a fully-verified WorkbookBundle or a fail-closed BundleLoadError.

§Errors

Returns BundleLoadError::UnexpectedMember for an extra member, BundleLoadError::IntegrityMismatch for a byte-flip/swap, BundleLoadError::StampMismatch for a provenance desync, BundleLoadError::Parse for malformed JSON, or BundleLoadError::Source for a read failure.