[−][src]Struct version_compare::version_manifest::VersionManifest
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]
fn eq(&self, other: &VersionManifest) -> bool
[src]
fn ne(&self, other: &VersionManifest) -> bool
[src]
impl StructuralPartialEq for VersionManifest
[src]
Auto Trait Implementations
impl RefUnwindSafe for VersionManifest
impl Send for VersionManifest
impl Sync for VersionManifest
impl Unpin for VersionManifest
impl UnwindSafe for VersionManifest
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,