[][src]Struct sentry_release_parser::Version

pub struct Version<'a> { /* fields omitted */ }

Represents a parsed version.

Methods

impl<'a> Version<'a>[src]

pub fn parse(version: &'a str) -> Result<Version<'a>, InvalidVersion>[src]

Parses a version from a string.

pub fn as_semver(&self) -> Version[src]

Converts the version into a semver.

Requires the semver feature.

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

Returns the major version component.

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

Returns the minor version component.

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

Returns the patch level version component.

pub fn pre(&self) -> Option<&str>[src]

If a pre-release identifier is included returns that.

pub fn build_code(&self) -> Option<&str>[src]

If a build code is included returns that.

pub fn normalized_build_code(&self) -> String[src]

Returns an internally normalized build code.

This value is useful for ordering but it should never be shown to a user as it might be very confusing. For instance if a build code looks like a dotted version it ends up being padded to 32 characters.

pub fn raw(&self) -> &str[src]

Returns the raw version as string.

It's generally better to use to_string which normalizes.

pub fn triple(&self) -> (u64, u64, u64)[src]

Returns the version triple (major, minor, patch)

pub fn quad(&self) -> (u64, u64, u64, Option<&str>)[src]

Returns the version triple with an added pre-release marker.

Trait Implementations

impl<'a> Clone for Version<'a>[src]

impl<'a> Debug for Version<'a>[src]

impl<'a> Display for Version<'a>[src]

impl<'a> PartialEq<Version<'a>> for Version<'a>[src]

impl<'a> StructuralPartialEq for Version<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Version<'a>

impl<'a> Send for Version<'a>

impl<'a> Sync for Version<'a>

impl<'a> Unpin for Version<'a>

impl<'a> UnwindSafe for Version<'a>

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.