pub struct BundleManifest {
pub schema_version: u32,
pub name: String,
pub runtime: BundleRuntime,
pub requires_contract: ContractVersion,
pub content: BTreeMap<String, BundleHash>,
}Expand description
The parsed manifest.toml at a bundle’s root — the bundle’s identity plus
the per-file content map that makes it content-addressed.
Fields§
§schema_version: u32Wire-format version. Always SCHEMA_VERSION today.
name: StringHuman-readable bundle name, e.g. "yah-marketing". Not part of the
content-address surface beyond the digest — two bundles with the same
bytes but different names have different digests.
runtime: BundleRuntimeRuntime selection ("self" / "mesofact/<ver>").
requires_contract: ContractVersionThe bundle↔runtime contract version this bundle was built against
(R746-F6). Whatever serves it must advertise this version; see
contract for what the four clauses of version 1 are.
Defaulted rather than required so a bundle published before the field
existed still parses — and parses as exactly what it is, since every
such bundle was assembled against contract 1. That default is also what
keeps their digests intact; see BundleManifest::digest.
Declared before content because TOML puts a table’s keys after it —
a scalar field serialized after [content] would land inside the table.
content: BTreeMap<String, BundleHash>Every file the bundle carries, keyed by its path within the bundle
(e.g. "app/dist/index.html", "bins/x86_64-unknown-linux-musl/serve")
mapped to its BLAKE3 content hash. Sorted (BTreeMap) so the manifest
serialization — and therefore the digest — is deterministic.
Implementations§
Source§impl BundleManifest
impl BundleManifest
Sourcepub fn from_toml_str(s: &str) -> Result<Self, BundleError>
pub fn from_toml_str(s: &str) -> Result<Self, BundleError>
Parse a manifest.toml string, rejecting an unknown schema version.
Sourcepub fn to_toml_string(&self) -> Result<String, BundleError>
pub fn to_toml_string(&self) -> Result<String, BundleError>
Serialize back to manifest.toml form.
Sourcepub fn digest(&self) -> BundleHash
pub fn digest(&self) -> BundleHash
The bundle’s content-address: a BLAKE3 digest over the manifest’s identity + content map.
Computed over a canonical, order-stable byte encoding (not the TOML text,
which whitespace/comments could perturb): schema_version, name, the
runtime wire string, then every (path, hash) pair in sorted path order.
Any change to any file’s bytes (its hash), the name, the runtime, or the
file set flips the digest — that immutability is what makes rollback a
pointer flip and eviction a no-invalidation affair (W272 §1).
requires_contract is fed only when it is not 1 (R746-F6). It is
identity-affecting — two bundles differing only in the interface they
demand are different bundles — but feeding it unconditionally would
re-hash every already published manifest to a new value, and
[fetch_manifest] verifies a fetched manifest against the digest it was
stored under. Every such manifest defaults to 1, so skipping the default
leaves their encoding byte-identical while any bundle requiring contract
≥ 2 still gets a distinct digest. The skip is not a place-holder to tidy
up later: the manifests it protects are immutable and permanent.
Trait Implementations§
Source§impl Clone for BundleManifest
impl Clone for BundleManifest
Source§impl Debug for BundleManifest
impl Debug for BundleManifest
Source§impl<'de> Deserialize<'de> for BundleManifest
impl<'de> Deserialize<'de> for BundleManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BundleManifest
Source§impl PartialEq for BundleManifest
impl PartialEq for BundleManifest
Source§impl Serialize for BundleManifest
impl Serialize for BundleManifest
impl StructuralPartialEq for BundleManifest
Auto Trait Implementations§
impl Freeze for BundleManifest
impl RefUnwindSafe for BundleManifest
impl Send for BundleManifest
impl Sync for BundleManifest
impl Unpin for BundleManifest
impl UnsafeUnpin for BundleManifest
impl UnwindSafe for BundleManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.