[−][src]Crate chronver
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 chrono::NaiveDate; assert!(Version::parse("2020.01.06") == Ok(Version { date: NaiveDate::from_ymd(2020, 1, 6), 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
Version | Represents a version number conforming to the chronologic versioning scheme. |
Enums
ChronVerError | An error type for this crate. |
Label | A label in the version metadata. |