pub struct Version {
pub numeric_identifiers: NumericIdentifiers,
pub suffix: Option<String>,
}
Fields§
§numeric_identifiers: NumericIdentifiers
Series of numbers, usually representing major, minor and patch (when semantic versioning is respected).
suffix: Option<String>
Equivalent of prerelease and/or build metadata in semantic versioning syntax.
Implementations§
Source§impl Version
impl Version
Sourcepub fn parse(text: &str) -> Result<Self, Error>
pub fn parse(text: &str) -> Result<Self, Error>
Try to create Version
from given string.
If the string contains a -
character, it is split in two, the first part will be considered as the numeric identifier and the 2nd one as suffix.
Sourcepub fn matches(&self, vr: &VersionRequirement) -> bool
pub fn matches(&self, vr: &VersionRequirement) -> bool
Evaluate whether self
satisfies the given VersionRequirement
.
Trait Implementations§
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more