Expand description
vers version ranges (the version-range notation CLE and PURL use),
parsed in full and evaluated for SemVer and PyPI versions.
Experimental: may change in a 0.x minor release.
VersRange::parse checks the syntax of any vers:<type>/<constraints>
string. VersRange::contains_semver then evaluates it when its type
compares versions as SemVer 2.0 (VersRange::is_semver_type): semver,
and npm, whose registered vers type uses node-semver versions.
VersRange::contains_pypi evaluates the pypi type with PEP 440
ordering (crate::pep440). Every other type is reported as unsupported,
never guessed.
The rules are from the vers specification, release v1.2.1 of
https://github.com/package-url/vers-spec (docs/specification/):
constraints are sorted by version, each version occurs once, * stands
alone, and outside != the comparators alternate between lower and upper
bounds. A range that breaks these rules is an error, not corrected.
Structs§
- Constraint
- One constraint: a comparator and a percent-decoded version.
- Vers
Range - A parsed
versrange.
Enums§
- Comparator
- The comparator of one constraint.
- Vers
Error - Why a string is not a valid
versrange, or could not be evaluated.
Constants§
- MAX_
VERS_ BYTES - Inputs longer than this are rejected with
VersError::TooLong.