Module debian_control::relations

source ·
Expand description

Parser for relationship fields like Depends, Recommends, etc.

§Example

use debian_control::relations::{Relations, Relation, VersionConstraint};

let mut relations: Relations = r"python3-dulwich (>= 0.19.0), python3-requests, python3-urllib3 (<< 1.26.0)".parse().unwrap();
assert_eq!(relations.to_string(), "python3-dulwich (>= 0.19.0), python3-requests, python3-urllib3 (<< 1.26.0)");
assert!(relations.satisfied_by(&mut |name| {
   match name {
   "python3-dulwich" => Some("0.19.0".parse().unwrap()),
   "python3-requests" => Some("2.25.1".parse().unwrap()),
   "python3-urllib3" => Some("1.25.11".parse().unwrap()),
   _ => None
   }}));
relations.remove(1);
relations.get_entry(0).unwrap().get_relation(0).unwrap().set_archqual("amd64");
assert_eq!(relations.to_string(), "python3-dulwich:amd64 (>= 0.19.0), python3-urllib3 (<< 1.26.0)");

Structs§

Enums§