Skip to main content

VersionSource

Enum VersionSource 

Source
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 (rustCargo.toml, nodepackage.json, pythonpyproject.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

Source

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

Source§

fn clone(&self) -> VersionSource

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 Copy for VersionSource

Source§

impl Debug for VersionSource

Source§

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

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

impl Eq for VersionSource

Source§

impl PartialEq for VersionSource

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VersionSource

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.