pub struct PackageBuilder { /* private fields */ }Expand description
Deterministic writer for the .aion ZIP container format.
Implementations§
Source§impl PackageBuilder
impl PackageBuilder
Sourcepub fn with_source<I, N, B>(
manifest: Manifest,
beams: BeamSet,
source: I,
) -> Self
pub fn with_source<I, N, B>( manifest: Manifest, beams: BeamSet, source: I, ) -> Self
Creates a builder with optional source files keyed by logical module name.
Sourcepub fn with_contract(self, contract: PackageContract) -> Self
pub fn with_contract(self, contract: PackageContract) -> Self
Replaces the manifest-derived record with the complete compiled contract.
Sourcepub fn with_awl_source(self, awl: AwlSource) -> Self
pub fn with_awl_source(self, awl: AwlSource) -> Self
Archives the authored AWL document and its imported schema files as package provenance.
Additive: it touches neither the manifest nor the contract, so it is
safe in any order relative to Self::with_contract, and it cannot
change the package version (see this module’s archive-layout note).
Sourcepub fn finalise_manifest(&self) -> Result<Manifest, PackageError>
pub fn finalise_manifest(&self) -> Result<Manifest, PackageError>
Returns the manifest after stamping the authoritative beam content hash.
§Errors
Returns PackageError::MissingEntryModule when the manifest entry module
is not present in the supplied beam set.
Sourcepub fn write_to_bytes(&self) -> Result<Vec<u8>, PackageError>
pub fn write_to_bytes(&self) -> Result<Vec<u8>, PackageError>
Writes a deterministic .aion archive into memory.
§Errors
Returns PackageError variants for missing entry modules, manifest JSON
serialisation failures, ZIP writer failures, or target I/O failures.
Sourcepub fn write_to_path(&self, path: impl AsRef<Path>) -> Result<(), PackageError>
pub fn write_to_path(&self, path: impl AsRef<Path>) -> Result<(), PackageError>
Writes a deterministic .aion archive to the supplied filesystem path.
§Errors
Returns PackageError variants for missing entry modules, manifest JSON
serialisation failures, ZIP writer failures, or target I/O failures.
Trait Implementations§
Source§impl Clone for PackageBuilder
impl Clone for PackageBuilder
Source§fn clone(&self) -> PackageBuilder
fn clone(&self) -> PackageBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more