| Crates.io | debversion |
| lib.rs | debversion |
| version | 0.4.7 |
| created_at | 2023-07-08 15:05:16.244367+00 |
| updated_at | 2025-08-10 12:48:44.213992+00 |
| description | Debian version parsing, manipulation and comparison |
| homepage | https://github.com/jelmer/debversion-rs |
| repository | https://github.com/jelmer/debversion-rs |
| max_upload_size | |
| id | 911514 |
| size | 126,023 |
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);
The sqlx feature adds serialization support for the postgres
debversion extension when using sqlx.
The python-debian feature provides conversion support between the debversion
Rust type and the Version class provided by python-debian, when using
pyo3.
The serde feature enables serialization to and from simple strings when
using serde.