Skip to main content

Distribution

Struct Distribution 

Source
pub struct Distribution {
    pub adapter: DistributionAdapter,
    pub gh_releases: bool,
    pub installers: Vec<Installer>,
    pub homebrew_tap: Option<String>,
    pub platforms: Vec<String>,
}
Expand description

The binary-distribution block: multi-platform GitHub-Release binaries, a generated installer set, and an optional Homebrew tap — produced by a tag-triggered release workflow (cargo-dist / goreleaser).

SEPARATE from Target (registry publishes): a cargo-dist repo attaches per-platform binaries to its GitHub Release, ships a shell/Homebrew installer, and independently publishes its crate to crates.io — the crates.io publish is a Target; everything binary-distribution is this block. The two coexist, which is exactly the “registry publish alongside a cargo-dist release” the contract could not express before. First-class (not prose) so downstream members SEE the tap + installer and neither under-describe the release nor regenerate the existing release.yml.

Option on Contract: null for a registry-only repo (the common case), so this addition leaves every existing contract’s shape unchanged.

Fields§

§adapter: DistributionAdapter

The binary-distribution engine that owns the tag-triggered release workflow.

§gh_releases: bool

Whether multi-platform binaries are attached to the GitHub Release.

§installers: Vec<Installer>

Installer flavors this release produces (may be empty), canonically ordered and de-duplicated.

§homebrew_tap: Option<String>

The Homebrew tap repo (owner/repo) the generated formula is pushed to, or null when no tap is used. Required when installers includes homebrew (floor).

§platforms: Vec<String>

The platform target set — the target-triples this binary distribution builds and ships, in Rust target-triple form (the vocabulary the cargo-dist adapter consumes; a goreleaser/manual remodel into an adapter-neutral shape is deliberately left to a follow-up). Always non-empty in the canonical output: defaulted to the cross-platform DEFAULT_CROSS_PLATFORM_TARGETS set (macOS + Linux) when the source OMITS it (an explicit empty list is rejected, not defaulted), so a distribution that doesn’t specify platforms still covers Linux (the cross-platform install requirement). An explicit set is validated per triple and de-duplicated, preserving the author’s order. Validation is STRUCTURAL, not semantic — a well-formed triple whose OS component stays inspectable, so the cross-platform audit can flag a Linux-less explicit set; the normalizer guarantees only that the field is present and every triple well-formed, never that the set covers any particular OS or that the toolchain will build it.

Trait Implementations§

Source§

impl Clone for Distribution

Source§

fn clone(&self) -> Distribution

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Distribution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Distribution

Source§

impl PartialEq for Distribution

Source§

fn eq(&self, other: &Distribution) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Distribution

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Distribution

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.