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 AsVersion for Version
impl AsVersion for Version
Source§fn into_version(self) -> Result<Version, ParseError>
fn into_version(self) -> Result<Version, ParseError>
Convert the argument into a Version
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Eq for Version
Auto Trait Implementations§
impl Freeze for Version
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