pub struct Package { /* private fields */ }Expand description
A validated, integrity-checked .aion package loaded fully into memory.
The engine performs actual VM registration. This crate only supplies the validated manifest, canonical beam bytes, optional source, and deployed module names the engine can register.
Implementations§
Source§impl Package
impl Package
Sourcepub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, PackageError>
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, PackageError>
Loads a .aion package from a filesystem path.
§Errors
Returns a typed PackageError for unreadable archives, malformed
manifests or entries, unsupported format versions, integrity mismatches,
or missing entry modules.
Sourcepub fn load_from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, PackageError>
pub fn load_from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, PackageError>
Loads a .aion package from an in-memory byte buffer.
§Errors
Returns a typed PackageError for unreadable archives, malformed
manifests or entries, unsupported format versions, integrity mismatches,
or missing entry modules.
Sourcepub const fn manifest(&self) -> &Manifest
pub const fn manifest(&self) -> &Manifest
Returns the validated manifest loaded from manifest.json.
Sourcepub const fn beams(&self) -> &BeamSet
pub const fn beams(&self) -> &BeamSet
Returns the canonical compiled beam set extracted from beam/ entries.
Sourcepub const fn source(&self) -> &BTreeMap<String, Vec<u8>>
pub const fn source(&self) -> &BTreeMap<String, Vec<u8>>
Returns optional Gleam source files extracted verbatim from src/ entries.
Sourcepub const fn content_hash(&self) -> &ContentHash
pub const fn content_hash(&self) -> &ContentHash
Returns the recomputed content hash that proved package integrity.
Sourcepub fn version_record(&self) -> WorkflowVersion
pub fn version_record(&self) -> WorkflowVersion
Produces the canonical cross-system version record for this loaded package.
Sourcepub fn deployed_modules(&self) -> Vec<(String, &[u8])>
pub fn deployed_modules(&self) -> Vec<(String, &[u8])>
Returns engine-ready deployed module names paired with their beam bytes.
The engine performs the actual VM registration; this crate only supplies the validated namespaced names and exact module bytes.
Sourcepub fn deployed_entry_module(&self) -> String
pub fn deployed_entry_module(&self) -> String
Returns the deployed namespaced module name for the manifest entry module.