Expand description
Minimal semver constraint matching for { registry = …, version = "…" } dependency resolution (#893).
Not a full semver implementation — no pre-release or build-metadata
ordering — but enough to resolve ^, ~, exact, and comparator
(>= > <= <) constraints against a set of published
MAJOR.MINOR.PATCH release versions. Resolution is deterministic:
best_match always returns the highest satisfying version, so a
lex.lock pins a reproducible choice.
Caret/tilde follow Cargo’s rules (the left-most non-zero component is
the “fixed” one for ^; ~ fixes down to the last given component).
Functions§
- best_
match - The highest of
versionsthat satisfiesconstraint, orNoneif none do. Deterministic — the resolver records this exact version in the lock file. - parse_
exact - Parse a full
MAJOR.MINOR.PATCH(a leadingvallowed). Exactly three components, unlike [parse_partial]. - satisfies
- Does
version(aMAJOR.MINOR.PATCHstring) satisfyconstraint? An unparseable version never matches; an unparseable constraint matches nothing (the caller should surface “cannot resolve” rather than guess).
Type Aliases§
- Version
- A
(major, minor, patch)version.