Skip to main content

Module version

Module version 

Source
Expand description

Semantic Versioning 2.0.0: parsing, precedence, bumps and Cargo-style requirements.

Version is a strict semver version (with a lenient parser for v1.2), VersionReq a requirement such as ^1.2 or >=1.0, <2.0 using Cargo’s rules, and compare / satisfies are the one-line versions for strings. Bad input is a typed error, never a guess.

Structs§

Version
A Semantic Versioning 2.0.0 version: MAJOR.MINOR.PATCH, optionally with a pre-release (-alpha.1) and build metadata (+sha.5114f85).
VersionReq
A version requirement such as ^1.2, >=1.0, <2.0 or 1.*: which versions are acceptable.

Enums§

ParseVersionError
Why a version or a version requirement could not be parsed.

Functions§

compare
Compares two version strings by semver precedence.
satisfies
Whether the version version satisfies the requirement requirement, both given as text.