uv/crates/puffin-resolver/src/resolver/index.rs
Charlie Marsh a8e52d2899
Split resolver.rs into a module (#752)
This is just getting hard to navigate. No code changes, just moving
stuff around.
2024-01-03 14:02:30 -05:00

26 lines
873 B
Rust

use url::Url;
use distribution_types::{IndexUrl, PackageId};
use pep440_rs::VersionSpecifiers;
use puffin_normalize::PackageName;
use puffin_traits::OnceMap;
use pypi_types::{BaseUrl, Metadata21};
use crate::version_map::VersionMap;
/// In-memory index of package metadata.
#[derive(Default)]
pub(crate) struct Index {
/// A map from package name to the metadata for that package and the index where the metadata
/// came from.
pub(crate) packages: OnceMap<PackageName, (IndexUrl, BaseUrl, VersionMap)>,
/// A map from package ID to metadata for that distribution.
pub(crate) distributions: OnceMap<PackageId, Metadata21>,
/// A map from package ID to required Python version.
pub(crate) incompatibilities: OnceMap<PackageId, VersionSpecifiers>,
/// A map from source URL to precise URL.
pub(crate) redirects: OnceMap<Url, Url>,
}