pub struct Evr<'a> { /* private fields */ }
Expand description
A full RPM “version” specifier has 3 different components - Epoch, Version, and Release.
You are not expected to create these manually, but rather from existing RPMs.
Epoch overrides all other fields and is generally only used as a last resort - in cases where a change to the versioning scheme or packaging error creates a situation where newer packages might otherwise sort as being older.
Version is the normal version string used by the upstream project. This shouldn’t be tweaked by the packager.
Release indicates firstly the number of times this package has been released - for instance, with custom patches and backports not present in the upstream, but may also indicate other details such as the OS it was built for (fc38, el9) or portions of a git commit hash.
Tilde (~) and caret (^) are special values used in particular situations. Including ~ in a version is used for denoting pre-releases and will force it to sort as less than a version without a caret, e.g. 0.5.0 vs 0.5.0~rc1. Including ^ in a version is used for denoting snapshots not directly associated with an upstream release and will force it to sort higher, e.g. 0.5.0 vs 0.5.0^deadbeef
Implementations§
source§impl<'a> Evr<'a>
impl<'a> Evr<'a>
sourcepub fn new<T: Into<Cow<'a, str>>>(epoch: T, version: T, release: T) -> Evr<'a>
pub fn new<T: Into<Cow<'a, str>>>(epoch: T, version: T, release: T) -> Evr<'a>
Create a new EVR
sourcepub fn as_normalized_form(&self) -> String
pub fn as_normalized_form(&self) -> String
Write an EVR string in a normalized form which always includes an epoch
The standard string representation of an EVR will ignore the epoch if not set. A package having no epoch value is equivalent to having an epoch of zero. Sometimes it is useful to write NEVRAs in a form such that equivalent values are represented identically, therefore, this “normalized” form will always include it.
Trait Implementations§
source§impl<'a> Ord for Evr<'a>
impl<'a> Ord for Evr<'a>
source§impl<'a> PartialEq for Evr<'a>
impl<'a> PartialEq for Evr<'a>
source§impl<'a> PartialOrd for Evr<'a>
impl<'a> PartialOrd for Evr<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for Evr<'a>
Auto Trait Implementations§
impl<'a> Freeze for Evr<'a>
impl<'a> RefUnwindSafe for Evr<'a>
impl<'a> Send for Evr<'a>
impl<'a> Sync for Evr<'a>
impl<'a> Unpin for Evr<'a>
impl<'a> UnwindSafe for Evr<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more