version
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.
Install
Section titled “Install”Cargo feature version (enabled by default). To compile only this module:
or in Cargo.toml:
Import path: helpers4::version.
| Item | What it does |
|---|---|
compare | Compares two version strings by semver precedence. |
satisfies | Whether the version version satisfies the requirement requirement, both given as text. |
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. |
Error types
Section titled “Error types”Documented on the page of the helper that returns them.
| Type | Returned by |
|---|---|
ParseVersionError | compare, satisfies, Version, VersionReq |
