pub enum VersionSource {
Manifest,
Distribution,
}Expand description
Whether a publish target derives its release version from a package manifest
the version guard can read, or has no manifest version by design — the capability
the fail-closed guard keys on (version-source-fail-closed-nonrust).
The distinction is a function of the target’s Ecosystem, not its publish
registry. A Rust/Node/Python package carries its version in a manifest
(Cargo.toml/package.json/pyproject.toml) regardless of where it is
published — a Rust crate repackaged for a Homebrew tap still reads its version
from Cargo.toml, so it is Manifest. Keying on the
registry instead would wrongly treat that crate (and a binary-distribution-only
Rust repo) as versionless and refuse to derive a version that is plainly in the
tree.
Variants§
Manifest
The ecosystem carries the package version in a manifest
(rust←Cargo.toml, node←package.json, python←pyproject.toml/setup.py).
A resolved target of this class must expose a detected manifest version in
facts; a resolved package with none is a detector failure that fails the
guard closed (VersionResolveError::MissingManifestVersion) rather than
silently skipping the version check (the fail-OPEN gap for manifest-versioned
non-Rust ecosystems this model closes).
Distribution
No manifest version by design: the ecosystem’s version does not live in a
tree manifest — a raw binary distribution (its version binds to the artifact
it ships), or a VCS-tag-versioned go module (go.mod declares no version).
Legitimately skipped by the version guard: there is no manifest to read a
version from and none is expected.
Implementations§
Source§impl VersionSource
impl VersionSource
Sourcepub fn of(ecosystem: Ecosystem) -> Self
pub fn of(ecosystem: Ecosystem) -> Self
Classify a target by its Ecosystem (the ecosystem is the authority on
whether a package’s version lives in a tree manifest).
Exhaustive over Ecosystem on purpose — a new ecosystem must make a
deliberate manifest-vs-distribution choice here rather than default to a silent
skip (which would re-open the fail-OPEN gap).
Trait Implementations§
Source§impl Clone for VersionSource
impl Clone for VersionSource
Source§fn clone(&self) -> VersionSource
fn clone(&self) -> VersionSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VersionSource
Source§impl Debug for VersionSource
impl Debug for VersionSource
impl Eq for VersionSource
Source§impl PartialEq for VersionSource
impl PartialEq for VersionSource
impl StructuralPartialEq for VersionSource
Auto Trait Implementations§
impl Freeze for VersionSource
impl RefUnwindSafe for VersionSource
impl Send for VersionSource
impl Sync for VersionSource
impl Unpin for VersionSource
impl UnsafeUnpin for VersionSource
impl UnwindSafe for VersionSource
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.