std::text::semverSemantic versioning โ pure Hew implementation.
Parse, inspect, compare, and match semantic version strings according to the SemVer 2.0.0 specification.
import std::text::semver;
fn main() {
let v = semver.parse("1.2.3-beta.1");
println(v.major());
if v.matches(">=1.0.0") {
println("compatible");
}
}
parseParse a semantic version string.
Panics if the string is not a valid semantic version.
version_to_stringFormat a Version as its canonical string representation.
compare_versionsCompare two versions according to SemVer 2.0 precedence rules.
compare_preCompare two dot-separated pre-release identifier strings.
compare_pre_idCompare two individual pre-release identifiers (numeric or alphanumeric).
matches_reqTest whether a version satisfies a comma-separated requirement string.
matches_singleTest whether a version satisfies a single version constraint.
VersionA parsed semantic version.
VersionMethodsMethods available on a parsed Version.