Skip to main content

aion_package/
lib.rs

1//! Archive validation, content hashing, and namespacing for Aion packages.
2//!
3//! This crate loads `.aion` archives, validates manifests and BEAM entries,
4//! computes stable content hashes, and derives deployed module names for engine
5//! registration.
6//!
7//! # Example
8//!
9//! ```no_run
10//! use aion_package::{ExtractionLimits, Package};
11//!
12//! // Operator-local file: extraction may run unbounded. Network input must
13//! // use `ExtractionLimits::bounded` instead.
14//! let package = Package::load_from_path("workflow.aion", ExtractionLimits::unbounded())?;
15//! println!("entry module: {}", package.manifest().entry_module);
16//! # Ok::<(), Box<dyn std::error::Error>>(())
17//! ```
18
19/// Compiled BEAM module records extracted from packages.
20pub mod beam;
21/// Archive builder utilities for tests and packaging tools.
22pub mod builder;
23/// Package validation and archive-loading errors.
24pub mod error;
25/// Explicit inflate budgets for archive extraction.
26pub mod extraction;
27/// Stable content-hash calculation for package contents.
28pub mod hash;
29/// Manifest structures and format-version constants.
30pub mod manifest;
31/// Deployment namespace helpers for compiled module names.
32pub mod namespace;
33/// Validated in-memory package loading and accessors.
34pub mod package;
35/// Project-level packaging driven by `workflow.toml` descriptors.
36pub mod project;
37/// Workflow version identifiers derived from package content.
38pub mod version;
39
40pub use beam::{BeamModule, BeamSet, RESERVED_MODULE_NAMES};
41pub use builder::PackageBuilder;
42pub use error::PackageError;
43pub use extraction::ExtractionLimits;
44pub use hash::{ContentHash, content_hash};
45pub use manifest::{
46    CURRENT_FORMAT_VERSION, DeclaredActivity, Manifest, ManifestDigest, ManifestVersion,
47};
48pub use namespace::{
49    DEPLOYED_NAME_SEPARATOR, NamespaceError, ParsedDeployedName, deployed_name, deployed_names,
50    parse_deployed_name,
51};
52pub use package::Package;
53pub use project::{
54    ExcludedModule, ExcludedReason, PackageOptions, PackagedWorkflow, PackagingError,
55    ProjectReport, package_project,
56};
57pub use version::WorkflowVersion;