Struct version_compare::version_manifest::VersionManifest[][src]

pub struct VersionManifest { /* fields omitted */ }
Expand description

Version manifest (configuration).

A manifest (configuration) that is used respectively when parsing and comparing version strings.

Implementations

Version manifest implementation.

Constructor.

Examples

use version_compare::VersionManifest;

let mut manifest = VersionManifest::new();

// Ignore text parts
manifest.set_ignore_text(true);

The maximum depth of a version number. None if no depth is configured.

Examples

use version_compare::VersionManifest;

let manifest = VersionManifest::new();

match manifest.max_depth() {
    &Some(depth) => println!("Maximum depth of {}", depth),
    &None => println!("No maximum depth")
}

The maximum depth of a version number as numerical value. Zero is returned if no depth is configured.

Examples

use version_compare::VersionManifest;

let manifest = VersionManifest::new();

println!("Maximum depth of {}", manifest.max_depth_number());

Set the maximum depth of a version number.

Examples

use version_compare::VersionManifest;

let mut manifest = VersionManifest::new();

// Set the maximum depth to 3
manifest.set_max_depth(Some(3));

// Don't use a maximum depth
manifest.set_max_depth(None);

Set the maximum depth of a version number. Use zero to disable the maximum depth.

Examples

use version_compare::VersionManifest;

let mut manifest = VersionManifest::new();

// Set the maximum depth to 3
manifest.set_max_depth_number(3);

// Don't use a maximum depth
manifest.set_max_depth_number(0);

Check whether there’s a maximum configured depth.

Examples

use version_compare::VersionManifest;

let mut manifest = VersionManifest::new();

assert!(!manifest.has_max_depth());

manifest.set_max_depth(Some(3));
assert!(manifest.has_max_depth());

Check whether to ignore text parts in version numbers.

Examples

use version_compare::VersionManifest;

let manifest = VersionManifest::new();

if manifest.ignore_text() {
    println!("Text parts are ignored");
} else {
    println!("Text parts are not ignored");
}

Set whether to ignore text parts.

Examples

use version_compare::VersionManifest;

let mut manifest = VersionManifest::new();

// Ignore text parts
manifest.set_ignore_text(true);

// Don't ignore text parts
manifest.set_ignore_text(false);

Trait Implementations

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.