[][src]Struct rubric::helpers::system::Version

pub struct Version { /* fields omitted */ }

Represents a programs version.

You probably don't want to build this directly, see the Program enum.

Implementations

impl Version[src]

pub fn of(program: Program) -> Option<Self>[src]

Returns the installed version of the program provided.

use rubric::helpers::system::{Version, Program};

// Tests that git is installed
assert!(Version::of(Program::Git).is_some());

pub fn custom(major: u32, minor: u32, patch: u32) -> Self[src]

Makes a custom version number. Mostly use to compare to another

let v = Version::custom(4, 5, 6);
assert_eq!(v.major(), 4);
assert_eq!(v.minor(), 5);
assert_eq!(v.patch(), 6);

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

Returns the major version (first number)

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

Returns the minor version (second number)

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

Returns the patch version (third number)

Trait Implementations

impl Debug for Version[src]

impl Display for Version[src]

impl FromStr for Version[src]

type Err = ParseIntError

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

This splits by ".". Any values not found are set to 0.

impl PartialEq<Version> for Version[src]

impl StructuralPartialEq for Version[src]

Auto Trait Implementations

impl RefUnwindSafe for Version

impl Send for Version

impl Sync for Version

impl Unpin for Version

impl UnwindSafe for Version

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

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> IntoCollection<T> for T

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,