Struct debversion::Version
source · pub struct Version {
pub epoch: Option<u32>,
pub upstream_version: String,
pub debian_revision: Option<String>,
}Expand description
A Debian version string
Fields§
§epoch: Option<u32>The epoch of the version, if any
upstream_version: StringThe upstream version
debian_revision: Option<String>The Debian revision, if any
Implementations§
source§impl Version
impl Version
sourcepub fn canonicalize(&self) -> Version
pub fn canonicalize(&self) -> Version
Return canonicalized version of this version
Examples
use debversion::Version;
assert_eq!("1.0-0".parse::<Version>().unwrap().canonicalize(), "1.0".parse::<Version>().unwrap());
assert_eq!("1.0-1".parse::<Version>().unwrap().canonicalize(), "1.0-1".parse::<Version>().unwrap());sourcepub fn increment_debian(&mut self)
pub fn increment_debian(&mut self)
Increment the Debian revision.
For native packages, increment the upstream version number. For other packages, increment the debian revision.
Trait Implementations§
source§impl Ord for Version
impl Ord for Version
source§impl PartialEq<Version> for Version
impl PartialEq<Version> for Version
source§impl PartialOrd<Version> for Version
impl PartialOrd<Version> for Version
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 Eq for Version
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§
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