Expand description
Chronologic version parsing.
Chronologic versioning (see https://chronver.org) is a set of rules for assigning version numbers.
§ChronVer
overview
Given a version number YEAR.MONTH.DAY.CHANGESET_IDENTIFIER
, increment the:
- YEAR version when the year changes,
- MONTH version when the month changes,
- DAY version when the day changes, and the
CHANGESET_IDENTIFIER
everytime you commit a change to your package/project.
§Versions
A simple Version
can be constructed by using the parse
method:
use chronver::Version;
use time::macros::date;
assert!(Version::parse("2020.01.06") == Ok(Version {
date: date!(2020-01-06),
changeset: 0,
label: None,
}));
Versions can also be compared with each other:
use chronver::Version;
assert_ne!(
Version::parse("2020.01.06-alpha").unwrap(),
Version::parse("2020.01.06-beta").unwrap()
);
Structs§
- Date in the proleptic Gregorian calendar.
- Represents a version number conforming to the chronologic versioning scheme.
Enums§
- An error type for this crate.
- A label in the version metadata.
- Months of the year.