21 releases
0.4.5 | May 26, 2025 |
---|---|
0.4.4 | Oct 2, 2024 |
0.4.3 | Sep 5, 2024 |
0.4.1 | Jul 29, 2024 |
0.2.0 | Jul 17, 2023 |
#288 in Parser implementations
4,466 downloads per month
Used in 19 crates
(15 directly)
50KB
1K
SLoC
debian version handling in rust
This simple crate provides a struct for parsing, validating, manipulating and comparing Debian version strings.
It aims to follow the version specification as described in Debian policy
5.6.12 and consistent with the behaviour of dpkg
.
Example:
use debversion::Version;
let version: Version = "1.0-1".parse().unwrap();
assert_eq!(version.epoch, None);
assert_eq!(version.upstream_version, "1.0");
assert_eq!(version.debian_revision.as_deref(), Some("1"));
let version1: Version = "1.0-0".parse().unwrap();
let version2: Version = "1.0".parse().unwrap();
assert_eq!(version1, version2);
let version1: Version = "1.0-1".parse().unwrap();
let version2: Version = "1.0~alpha1-1".parse().unwrap();
assert!(version2 < version1);
Features
sqlx
The sqlx
feature adds serialization support for the postgres
debversion extension when using sqlx.
python-debian
The python-debian
feature provides conversion support between the debversion
Rust type and the Version
class provided by python-debian
, when using
pyo3.
serde
The serde
feature enables serialization to and from simple strings when
using serde.
Dependencies
~3–14MB
~167K SLoC