Struct version_compare::Manifest
source · Expand description
Version manifest (configuration).
A manifest (configuration) that is used respectively when parsing and comparing version strings.
Examples
use version_compare::{Manifest, Version};
// Create manifest with max depth of 2
let mut manifest = Manifest::default();
manifest.max_depth = Some(2);
// Version strings equal with manifest because we compare up-to 2 parts deep
let a = Version::from_manifest("1.0.1", &manifest).unwrap();
let b = Version::from_manifest("1.0.2", &manifest).unwrap();
assert!(a == b);
Fields
max_depth: Option<usize>
The maximum depth of a version number.
This specifies the maximum number of parts. There is no limit if None
is set.
ignore_text: bool
Whether to ignore text parts in version strings.
Implementations
sourceimpl Manifest
impl Manifest
Version manifest implementation.
sourcepub fn has_max_depth(&self) -> bool
pub fn has_max_depth(&self) -> bool
Check whether there’s a maximum configured depth.
Examples
use version_compare::Manifest;
let mut manifest = Manifest::default();
assert!(!manifest.has_max_depth());
manifest.max_depth = Some(3);
assert!(manifest.has_max_depth());
Trait Implementations
impl Eq for Manifest
impl StructuralEq for Manifest
impl StructuralPartialEq for Manifest
Auto Trait Implementations
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more