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]
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 Clone for ArtifactVersion
[src]fn clone(&self) -> ArtifactVersion
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for ArtifactVersion
[src]
impl Eq for ArtifactVersion
[src]impl FromStr for ArtifactVersion
[src]
impl FromStr for ArtifactVersion
[src]impl Hash for ArtifactVersion
[src]
impl Hash for ArtifactVersion
[src]impl Ord for ArtifactVersion
[src]
impl Ord for ArtifactVersion
[src]impl PartialEq<ArtifactVersion> for ArtifactVersion
[src]
impl PartialEq<ArtifactVersion> for ArtifactVersion
[src]impl PartialOrd<ArtifactVersion> for ArtifactVersion
[src]
impl PartialOrd<ArtifactVersion> for ArtifactVersion
[src]impl StructuralEq for ArtifactVersion
[src]
impl StructuralEq for ArtifactVersion
[src]Auto Trait Implementations
impl RefUnwindSafe for ArtifactVersion
impl RefUnwindSafe for ArtifactVersion
impl Send for ArtifactVersion
impl Send for ArtifactVersion
impl Sync for ArtifactVersion
impl Sync for ArtifactVersion
impl Unpin for ArtifactVersion
impl Unpin for ArtifactVersion
impl UnwindSafe for ArtifactVersion
impl UnwindSafe for ArtifactVersion