pub struct Version { /* private fields */ }Expand description
A parsed RPM version: [epoch:]version[-release].
Wraps librpm’s opaque rpmver handle. Owns the underlying allocation
and frees it on drop.
Implementations§
Source§impl Version
impl Version
Sourcepub fn parse(evr: &str) -> Option<Self>
pub fn parse(evr: &str) -> Option<Self>
Parse an [epoch:]version[-release] string.
Returns None if the string is not a valid EVR.
§Panics
Panics if evr contains an interior NUL byte.
Sourcepub fn new(
epoch: Option<&str>,
version: &str,
release: Option<&str>,
) -> Option<Self>
pub fn new( epoch: Option<&str>, version: &str, release: Option<&str>, ) -> Option<Self>
Construct a version from individual components.
epoch and release are optional. Returns None if the inputs
are invalid.
§Panics
Panics if any argument contains an interior NUL byte.
Sourcepub fn epoch(&self) -> Option<&str>
pub fn epoch(&self) -> Option<&str>
Epoch string (e.g. "1"), or None if no epoch was specified.
Trait Implementations§
impl Eq for Version
Source§impl Ord for Version
impl Ord for Version
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Send for Version
impl Sync for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Unpin for Version
impl UnsafeUnpin for Version
impl UnwindSafe for Version
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