pub struct DistributionContract {
pub schema_version: u32,
pub product: ProductIdentity,
pub targets: Vec<TargetEntry>,
}Expand description
A versioned distribution contract (schema v1).
Fields§
§schema_version: u32Always SCHEMA_V1.
product: ProductIdentityOpaque product identity.
targets: Vec<TargetEntry>Supported targets (non-empty, deterministic order as written).
Implementations§
Source§impl DistributionContract
impl DistributionContract
Sourcepub fn parse_toml_str(s: &str) -> Result<Self, DistError>
pub fn parse_toml_str(s: &str) -> Result<Self, DistError>
Parses and structurally validates a TOML distribution contract.
Returns typed validation errors; never guesses, falls back, touches
the network, or rewrites the source. Unknown future schema versions
fail with DistError::UnsupportedVersion.
Sourcepub fn to_toml_string(&self) -> Result<String, DistError>
pub fn to_toml_string(&self) -> Result<String, DistError>
Serializes the contract deterministically to TOML.
Field and target order are preserved as stored, so golden outputs are stable for a given contract value.
Sourcepub fn resolve(&self, target_or_alias: &str) -> Result<&TargetEntry, DistError>
pub fn resolve(&self, target_or_alias: &str) -> Result<&TargetEntry, DistError>
Resolves a canonical triple or alias to its target entry.
Aliases are globally unambiguous; unknown inputs fail with
DistError::UnknownTarget instead of guessing a nearby architecture.
Sourcepub fn expand(
&self,
target_or_alias: &str,
version: &str,
) -> Result<ExpandedTarget, DistError>
pub fn expand( &self, target_or_alias: &str, version: &str, ) -> Result<ExpandedTarget, DistError>
Expands all file names for one target and opaque version string.
version is opaque (no SemVer ordering) but must be portable, because
it is interpolated into release file names: [A-Za-z0-9-_.+] only, so
no path separator, no platform-reserved character, and nothing
eggpack-manifest would later refuse as an artifact file name.
{alias} templates require looking up via that alias; looking up via
the triple when the template needs {alias} fails with
DistError::MissingInput. The expanded result is rejected if any
release or install filename collides, including ASCII case-only
collisions.
Trait Implementations§
Source§impl Clone for DistributionContract
impl Clone for DistributionContract
Source§impl Debug for DistributionContract
impl Debug for DistributionContract
impl Eq for DistributionContract
Source§impl PartialEq for DistributionContract
impl PartialEq for DistributionContract
impl StructuralPartialEq for DistributionContract
Auto Trait Implementations§
impl Forget for DistributionContract
impl Freeze for DistributionContract
impl Move for DistributionContract
impl RefUnwindSafe for DistributionContract
impl Send for DistributionContract
impl Sync for DistributionContract
impl Unpin for DistributionContract
impl UnsafeUnpin for DistributionContract
impl UnwindSafe for DistributionContract
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,
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.