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§
Sourcefn version_or_url(&self) -> VersionOrUrlRef<'_>
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§
Sourcefn version_id(&self) -> VersionId
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.
Sourcefn package_id(&self) -> PackageId
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".