pub struct PackageManifest<M> {
pub package: PackageHeader,
pub metadata: M,
pub python: Option<PythonPackageMeta>,
pub wasm: Option<WasmPackageMeta>,
}Expand description
A parsed package manifest, generic over the host-defined metadata schema.
The M type parameter is the host’s metadata schema. If the [metadata]
section of package.toml doesn’t deserialize into M, parsing fails —
this is how schema validation works.
Fields§
§package: PackageHeaderFixed header fields required by fidius.
metadata: MHost-defined metadata. Must deserialize from the [metadata] section.
python: Option<PythonPackageMeta>Python-runtime fields. Required when package.runtime == "python",
rejected otherwise. Validated by PackageManifest::validate_runtime
after deserialization, since serde alone can’t enforce cross-section
invariants.
wasm: Option<WasmPackageMeta>WASM-component fields. Required when package.runtime == "wasm",
rejected otherwise. Validated by PackageManifest::validate_runtime.
Implementations§
Source§impl<M> PackageManifest<M>
impl<M> PackageManifest<M>
Sourcepub fn validate_runtime(&self) -> Result<(), PackageError>
pub fn validate_runtime(&self) -> Result<(), PackageError>
Cross-section validation: runtime + python section must agree.
runtime = "rust"(or absent → “rust”) with a[python]section is rejected.runtime = "python"without a[python]section is rejected.- Unknown runtime values are rejected (forward compat: a future
runtime = "node"package shouldn’t silently fall back to rust).
Trait Implementations§
Source§impl<M: Clone> Clone for PackageManifest<M>
impl<M: Clone> Clone for PackageManifest<M>
Source§fn clone(&self) -> PackageManifest<M>
fn clone(&self) -> PackageManifest<M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more