Struct mvn_version::ArtifactVersion[][src]

pub struct ArtifactVersion { /* fields omitted */ }

This is an implementation of Maven’s DefaultArtifactVersion.

ArtifactVersion parses a version into major, minor, incremental, build, and qualifier components. The former three are separated by dots. The build or qualifier (there can only be one of the two) will be set by whatever is after a dash, if present. Missing components will be zero (in case of the numeric ones) or None (for the qualifier). In general, unknown version formats will be ungracefully dumped into the qualifier section, leaving everything else as zero.

See ComparableVersion for an overview of how versions are parsed for the purposes of comparison and equality. It’s used here internally for comparison operations.

Implementations

impl ArtifactVersion[src]

pub fn new(s: &str) -> Self[src]

Constructs an ArtifactVersion from the given string. This function cannot fail for any reason, and will always return a valid ComparableVersion. Make sure to strip whitespace before passing your input to this function. Otherwise, whitespace is treated identically to any other text. A empty string will parse as 0.0.0.0-, with an empty string in the qualifier section.

pub fn major(&self) -> u32[src]

The major version, or 0 if not specified.

pub fn minor(&self) -> u32[src]

The minor version, or 0 if not specified.

pub fn incremental(&self) -> u32[src]

The incremental version, or 0 if not specified.

pub fn build(&self) -> u32[src]

The build number, or 0 if not specified. If this is nonzero, qualifier will always be None.

pub fn qualifier(&self) -> &Option<String>[src]

The qualifier, or None if not specified. If this is Some, build will always be zero.

Trait Implementations

impl Clone for ArtifactVersion[src]

impl Debug for ArtifactVersion[src]

impl Display for ArtifactVersion[src]

impl Eq for ArtifactVersion[src]

impl From<&'_ str> for ArtifactVersion[src]

impl FromStr for ArtifactVersion[src]

type Err = Infallible

The associated error which can be returned from parsing.

impl Hash for ArtifactVersion[src]

impl Ord for ArtifactVersion[src]

impl PartialEq<ArtifactVersion> for ArtifactVersion[src]

impl PartialOrd<ArtifactVersion> for ArtifactVersion[src]

impl StructuralEq for ArtifactVersion[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.