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

pub struct VersionManifest { /* fields omitted */ }

Version manifest (configuration).

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

Implementations

impl VersionManifest[src]

Version manifest implementation.

pub fn new() -> Self[src]

Constructor.

Examples

use version_compare::VersionManifest;

let mut manifest = VersionManifest::new();

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

pub fn max_depth(&self) -> &Option<usize>[src]

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")
}

pub fn max_depth_number(&self) -> usize[src]

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());

pub fn set_max_depth(&mut self, max_depth: Option<usize>)[src]

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);

pub fn set_max_depth_number(&mut self, max_depth: usize)[src]

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);

pub fn has_max_depth(&self) -> bool[src]

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());

pub fn ignore_text(&self) -> bool[src]

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");
}

pub fn set_ignore_text(&mut self, ignore_text: bool)[src]

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

impl Debug for VersionManifest[src]

impl PartialEq<VersionManifest> for VersionManifest[src]

impl StructuralPartialEq for VersionManifest[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.