Skip to main content

uv_configuration/
resolution_mode.rs

1#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
2#[serde(deny_unknown_fields, rename_all = "kebab-case")]
3#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
5pub enum ResolutionMode {
6    /// Resolve the highest compatible version of each package.
7    #[default]
8    Highest,
9    /// Resolve the lowest compatible version of each package.
10    Lowest,
11    /// Resolve the lowest compatible version of any direct dependencies, and the highest
12    /// compatible version of any transitive dependencies.
13    LowestDirect,
14}
15
16impl std::fmt::Display for ResolutionMode {
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        match self {
19            Self::Highest => write!(f, "highest"),
20            Self::Lowest => write!(f, "lowest"),
21            Self::LowestDirect => write!(f, "lowest-direct"),
22        }
23    }
24}