Struct recital::version::Version [] [src]

pub struct Version {
    pub major: u64,
    pub minor: u64,
    pub patch: u64,
    pub pre: Vec<Identifier>,
    pub build: Vec<Identifier>,
}

Represents a semantic version number.

A semantic version number is a version number that conforms to a set of rules and requirements that have been defined in the Semantic Versioning specification. You may find the specification online at semver.org.

Fields

The major version number.

A major version number is used to indicate that a paritcular version is backward compatible with all other version numbers from the same major version number. For example, 1.999.999 is backwards compatible with 1.0.0, however 2.0.0 is not backwards compatible with 1.999.999.

The minor version number.

A minor version number is used to indicate that one or more features have been added that are compatible with earlier versions of the same major version number.

The patch version number.

A patch version number is used to indicate that one or more bugs have been fixed, but no new features have been added and compatibility with earlier versions of the same major version number is maintained.

The pre-release identifiers.

The pre-release identifiers are used to indicate that this version number is not stable. While the identifiers can be as many as you want with whatever information you want, you will most commonly find people use identifiers such as -alpha, -beta.3, -rc.1, and so on. There may also be no identifiers, which indicates that this may be a stable version number.

The build identifiers.

The build identifiers do not mean anything in a semantic version number. While they are structured similarly (+debug, +xyz.123, etc.), they have no impact when comparing version numbers. They are mostly there to help developers identify other bits of information.

Methods

impl Version
[src]

Removes all of the build identifiers.

Removes all of the pre-release and build identifiers.

Removes all of the pre-release identifiers.

Increments the major version number.

When a major version number is incremented, the minor and patch version numbers are set to zero. In addition, the pre-release and build identifiers are all removed.

Increments the minor version number.

When a minor version number is incremented, the patch version number is set to zero. In addition, the pre-release and build identifiers are all removed.

Increments the patch version number.

When a patch version number is incremented, the pre-release and build identifiers are all removed.

Checks if the version number is stable.

A version number is considered stable when it has a major version number that is greater than zero (0) and has no pre-release identifiers.

Creates a new version number with default values.

Trait Implementations

impl Clone for Version
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Version
[src]

Formats the value using the given formatter.

impl Eq for Version
[src]

impl Default for Version
[src]

Sets the default values for a Version.

use recital::version::Version;

let defaults = Version {
    major: 0,
    minor: 0,
    patch: 0,
    pre: Vec::new(),
    build: Vec::new(),
};

Returns the "default value" for a type. Read more

impl Display for Version
[src]

Formats the value using the given formatter. Read more

impl Ord for Version
[src]

This method returns an Ordering between self and other. Read more

impl PartialEq for Version
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl PartialOrd for Version
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl FromStr for Version
[src]

Enables parsing of strings as semantic version numbers.

let example: Version = "1.2.3-abc.456+def.789".parse().unwrap();

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more