Skip to main content

PackageBuilder

Struct PackageBuilder 

Source
pub struct PackageBuilder { /* private fields */ }
Expand description

Deterministic writer for the .aion ZIP container format.

Implementations§

Source§

impl PackageBuilder

Source

pub fn new(manifest: Manifest, beams: BeamSet) -> Self

Creates a builder without source files.

Source

pub fn with_source<I, N, B>( manifest: Manifest, beams: BeamSet, source: I, ) -> Self
where I: IntoIterator<Item = (N, B)>, N: Into<String>, B: Into<Vec<u8>>,

Creates a builder with optional source files keyed by logical module name.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> PackageBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PackageBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.