13 releases

0.2.2 Sep 27, 2023
0.2.1 Sep 10, 2023
0.2.0 Jul 17, 2023
0.1.9 Jul 17, 2023

#759 in Rust patterns

Download history 428/week @ 2023-10-30 883/week @ 2023-11-06 456/week @ 2023-11-13 985/week @ 2023-11-20 782/week @ 2023-11-27 668/week @ 2023-12-04 473/week @ 2023-12-11 743/week @ 2023-12-18 970/week @ 2023-12-25 387/week @ 2024-01-01 265/week @ 2024-01-08 222/week @ 2024-01-15 814/week @ 2024-01-22 480/week @ 2024-01-29 778/week @ 2024-02-05 793/week @ 2024-02-12

2,899 downloads per month
Used in 13 crates (10 directly)

Apache-2.0

23KB
537 lines

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.

Example:

use debversion::Version;

let version: Version = "1.0-1".parse()?;
assert_eq!(version.epoch, Some(0));
assert_eq!(version.upstream_version, "1.0");
assert_eq!(version.debian_revision, Some("1"));

let version1: Version = "1.0-0".parse()?;
let version2: Version = "1.0".parse()?;
assert_eq!(version1, version2);

let version1: Version = "1.0-1".parse()?;
let version2: Version = "1.0~alpha1-1".parse()?;
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.

serde

The serde feature enables serialization to and from simple strings when using serde.

Dependencies

~2–17MB
~217K SLoC