DistributionMetadata

Trait DistributionMetadata 

Source
pub trait DistributionMetadata: Name {
    // Required method
    fn version_or_url(&self) -> VersionOrUrlRef<'_>;

    // Provided methods
    fn version_id(&self) -> VersionId { ... }
    fn package_id(&self) -> PackageId { ... }
}
Expand description

Metadata that can be resolved from a requirements specification alone (i.e., prior to building or installing the distribution).

Required Methods§

Source

fn version_or_url(&self) -> VersionOrUrlRef<'_>

Return a uv_pep440::Version, for registry-based distributions, or a url::Url, for URL-based distributions.

Provided Methods§

Source

fn version_id(&self) -> VersionId

Returns a unique identifier for the package at the given version (e.g., black==23.10.0).

Note that this is not equivalent to a unique identifier for the distribution, as multiple registry-based distributions (e.g., different wheels for the same package and version) will return the same version ID, but different distribution IDs.

Source

fn package_id(&self) -> PackageId

Returns a unique identifier for a package. A package can either be identified by a name (e.g., black) or a URL (e.g., git+https://github.com/psf/black).

Note that this is not equivalent to a unique identifier for the distribution, as multiple registry-based distributions (e.g., different wheels for the same package and version) will return the same version ID, but different distribution IDs.

Implementors§