Skip to content

Commit

Permalink
Document the intended usage of DependencyProvider::M
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Apr 15, 2024
1 parent faa3fe7 commit 4dd3484
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,14 @@ pub trait DependencyProvider {
/// The requirements must be able to process the same kind of version as this dependency provider.
type VS: VersionSet<V = Self::V>;

/// How this provider stores metadata or additional context about incompatibilities
/// Type for custom incompatibilities.
///
/// There are reasons in user code outside pubgrub that can cause packages or versions
/// to be unavailable. Examples:
/// * The version would require building the package, but builds are disabled.
/// * The package is not available in the cache, but internet access has been disabled.
/// The intended use is to track them in an enum and assign them to this type. This also
/// supports collapsing custom incompatibilities in error messages.
type M: Eq + Clone + Debug + Display;

/// [Decision making](https://github.com/dart-lang/pub/blob/master/doc/solver.md#decision-making)
Expand Down

0 comments on commit 4dd3484

Please sign in to comment.