Crate chronver[][src]

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:

  1. YEAR version when the year changes,
  2. MONTH version when the month changes,
  3. DAY version when the day changes, and the
  4. 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.