pub struct PackageVersion { /* private fields */ }
Expand description
A version number of a Debian package
Version numbers consists of three components:
- an optional epoch
- the upstream version
- an optional debian revision
Implementations§
Source§impl PackageVersion
impl PackageVersion
Sourcepub fn new(
epoch: Option<u32>,
upstream_version: &str,
debian_revision: Option<&str>,
) -> Result<Self, VersionError>
pub fn new( epoch: Option<u32>, upstream_version: &str, debian_revision: Option<&str>, ) -> Result<Self, VersionError>
Create a new version struct from the individual components.
Sourcepub fn is_native(&self) -> bool
pub fn is_native(&self) -> bool
Returns whether version is a native version, i.e., there is no revision.
Sourcepub fn epoch_or_0(&self) -> u32
pub fn epoch_or_0(&self) -> u32
Return epoch of 0 if none set.
Sourcepub fn has_binnmu_version(&self) -> bool
pub fn has_binnmu_version(&self) -> bool
Return whether this version has a binNMU version, i.e., ends in +bX for some integer X.
Sourcepub fn binnmu_version(&self) -> Option<u32>
pub fn binnmu_version(&self) -> Option<u32>
Return binNMU version if available.
Sourcepub fn without_binnmu_version(self) -> Self
pub fn without_binnmu_version(self) -> Self
Obtain version without the binNMU version.
Sourcepub fn clone_without_binnmu_version(&self) -> Self
pub fn clone_without_binnmu_version(&self) -> Self
Obtain version without the binNMU version.
Trait Implementations§
Source§impl Clone for PackageVersion
impl Clone for PackageVersion
Source§fn clone(&self) -> PackageVersion
fn clone(&self) -> PackageVersion
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PackageVersion
impl Debug for PackageVersion
Source§impl<'de> Deserialize<'de> for PackageVersion
impl<'de> Deserialize<'de> for PackageVersion
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PackageVersion
impl Display for PackageVersion
Source§impl Hash for PackageVersion
impl Hash for PackageVersion
Source§impl Ord for PackageVersion
impl Ord for PackageVersion
Source§impl PartialEq for PackageVersion
impl PartialEq for PackageVersion
Source§impl PartialOrd for PackageVersion
impl PartialOrd for PackageVersion
Source§impl Serialize for PackageVersion
impl Serialize for PackageVersion
Source§impl TryFrom<&str> for PackageVersion
impl TryFrom<&str> for PackageVersion
impl Eq for PackageVersion
Auto Trait Implementations§
impl Freeze for PackageVersion
impl RefUnwindSafe for PackageVersion
impl Send for PackageVersion
impl Sync for PackageVersion
impl Unpin for PackageVersion
impl UnwindSafe for PackageVersion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.