Struct sentry_release_parser::Version
source · pub struct Version<'a> { /* private fields */ }
Expand description
Represents a parsed version.
Implementations§
source§impl<'a> Version<'a>
impl<'a> Version<'a>
sourcepub fn parse(version: &'a str) -> Result<Version<'a>, InvalidVersion>
pub fn parse(version: &'a str) -> Result<Version<'a>, InvalidVersion>
Parses a version from a string.
sourcepub fn as_semver(&self) -> Version
pub fn as_semver(&self) -> Version
Converts the version into a semver.
Requires the semver
feature.
sourcepub fn build_code(&self) -> Option<&'a str>
pub fn build_code(&self) -> Option<&'a str>
If a build code is included returns that.
sourcepub fn build_number(&self) -> Option<u64>
pub fn build_number(&self) -> Option<u64>
Returns the build code as build number.
sourcepub fn components(&self) -> u8
pub fn components(&self) -> u8
Returns the number of components.
sourcepub fn raw(&self) -> &'a str
pub fn raw(&self) -> &'a str
Returns the raw version as string.
It’s generally better to use to_string
which normalizes.
sourcepub fn raw_short(&self) -> &'a str
pub fn raw_short(&self) -> &'a str
Returns the part of the version raw before the build code.
This is useful as the system can mis-parse some versions and instead of formatting out the version from the parts, this can be used to format out the version part as it was input by the user but still abbreviate the build code.
Trait Implementations§
source§impl<'a> Ord for Version<'a>
impl<'a> Ord for Version<'a>
source§impl<'a> PartialEq<Version<'a>> for Version<'a>
impl<'a> PartialEq<Version<'a>> for Version<'a>
source§impl<'a> PartialOrd<Version<'a>> for Version<'a>
impl<'a> PartialOrd<Version<'a>> for Version<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for Version<'a>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more