Crate version_number
source · [−]Expand description
version-number
Synopsis
A crate to represent and parse two- and three-component version numbers of the form major.minor
,
and major.minor.patch
respectively. These version numbers are often seen within the Rust
project manifests.
Semver compatibility
The version numbers accepted by this crate are mostly a subset of semver version numbers,
with the exception of also allowing two component (shorthand) major.minor
versions.
For example, 1.0
and 1.0.0
are both accepted by this library, while the former is
rejected by semver
.
In addition crate::Version
does not accept extra labels such as build parameters, which are
an extension of the semver
version number itself.
Exception: leading zeros (To be removed)
Another exception where this library differs from semver is by accepting leading zeros, i.e. version number components starting with a zero (‘0’).
These are not allowed in semver (e.g. 01.0.0
is disallowed, but 1.0.0
is allowed).
This library currently however does allow leading zeroes (and the library does not
disambiguate between 01.0.0
and 1.0.0
, so both are seen as equivalent).
This is planned to change in a future version
Structs
A two-component major.minor
version.
A three-component major.minor.patch
version.