pub struct BundleWriter;Expand description
A build-tool-facing writer for the explicit final assembly boundary.
Implementations§
Source§impl BundleWriter
impl BundleWriter
Sourcepub fn write(
root: impl AsRef<Path>,
manifest: &ManifestDocument,
assets: &BTreeMap<AssetId, Vec<u8>>,
binaries: &BTreeMap<BundlePath, PathBuf>,
) -> Result<RuntimeBundle, BundleError>
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.