[][src]Enum versions::Versioning

pub enum Versioning {
    Ideal(SemVer),
    General(Version),
    Complex(Mess),
}

A top-level Versioning type which acts as a wrapper for the more specific types.

Examples

use versions::Versioning;

let a = Versioning::new("1.2.3-1").unwrap();   // SemVer.
let b = Versioning::new("1.2.3r1").unwrap();   // Not SemVer but good enough.
let c = Versioning::new("000.007-1").unwrap(); // Garbage.

assert!(a.is_ideal());
assert!(b.is_general());
assert!(c.is_complex());

Variants

Ideal(SemVer)
General(Version)
Complex(Mess)

Implementations

impl Versioning[src]

pub fn new(s: &str) -> Option<Versioning>[src]

Create a Versioning by attempting to parse the input first as SemVer, then as a Version, and finally as a Mess.

pub fn is_ideal(&self) -> bool[src]

A short-hand for detecting an inner SemVer.

pub fn is_general(&self) -> bool[src]

A short-hand for detecting an inner Version.

pub fn is_complex(&self) -> bool[src]

A short-hand for detecting an inner Mess.

Trait Implementations

impl Clone for Versioning[src]

impl Debug for Versioning[src]

impl Display for Versioning[src]

impl Eq for Versioning[src]

impl Hash for Versioning[src]

impl Ord for Versioning[src]

impl PartialEq<Versioning> for Versioning[src]

impl PartialOrd<Versioning> for Versioning[src]

impl StructuralEq for Versioning[src]

impl StructuralPartialEq for Versioning[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.