Skip to main content

BundleWriter

Struct BundleWriter 

Source
pub struct BundleWriter;
Expand description

A build-tool-facing writer for the explicit final assembly boundary.

Implementations§

Source§

impl BundleWriter

Source

pub fn write( root: impl AsRef<Path>, manifest: &ManifestDocument, assets: &BTreeMap<AssetId, Vec<u8>>, binaries: &BTreeMap<BundlePath, PathBuf>, ) -> Result<RuntimeBundle, BundleError>

Write one bundle: the manifest, the assets, and the binaries.

The bundle is assembled in a private sibling directory and only then renamed onto its final name, so the target is either absent or a complete bundle.

binaries maps the bundle-relative destination - bin/brain, bin/<service-id>, bin/<component-type> - to the executable to copy there. Nothing is hashed and nothing is recorded: the launcher derives the executable from the id it is launching, and integrity is the archive’s job.

§Errors

Returns BundleError::TargetExists when root already exists, BundleError::NotExecutable or BundleError::UnsupportedEntry when a supplied binary is not a runnable file, and BundleError::ReadFile for any other I/O failure. A failed write leaves no staging directory behind.

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> 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, 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.