pub struct PackageManifest<M> {
pub package: PackageHeader,
pub metadata: M,
pub python: Option<PythonPackageMeta>,
}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.
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 for PackageManifest<M>where
M: Clone,
impl<M> Clone for PackageManifest<M>where
M: Clone,
Source§fn clone(&self) -> PackageManifest<M>
fn clone(&self) -> PackageManifest<M>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M> Debug for PackageManifest<M>where
M: Debug,
impl<M> Debug for PackageManifest<M>where
M: Debug,
Source§impl<'de, M> Deserialize<'de> for PackageManifest<M>where
M: Deserialize<'de>,
impl<'de, M> Deserialize<'de> for PackageManifest<M>where
M: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PackageManifest<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PackageManifest<M>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<M> Serialize for PackageManifest<M>where
M: Serialize,
impl<M> Serialize for PackageManifest<M>where
M: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<M> Freeze for PackageManifest<M>where
M: Freeze,
impl<M> RefUnwindSafe for PackageManifest<M>where
M: RefUnwindSafe,
impl<M> Send for PackageManifest<M>where
M: Send,
impl<M> Sync for PackageManifest<M>where
M: Sync,
impl<M> Unpin for PackageManifest<M>where
M: Unpin,
impl<M> UnsafeUnpin for PackageManifest<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for PackageManifest<M>where
M: UnwindSafe,
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
Mutably borrows from an owned value. Read more