| Crates.io | debian-control |
| lib.rs | debian-control |
| version | 0.1.48 |
| created_at | 2023-06-16 00:05:28.813207+00 |
| updated_at | 2025-08-04 09:52:28.919631+00 |
| description | A parser for Debian control files |
| homepage | https://github.com/jelmer/deb822-lossless |
| repository | https://github.com/jelmer/deb822-lossless |
| max_upload_size | |
| id | 891666 |
| size | 445,453 |
This crate provides a parser for Debian control files. It is lossless, meaning that it will preserve the original formatting of the file. It also provides a way to serialize the parsed data back to a string.
use debian_control::{Control, Priority};
use std::fs::File;
let mut control = Control::new();
let mut source = control.add_source("hello");
source.set_section("rust");
let mut binary = control.add_binary("hello");
binary.set_architecture("amd64");
binary.set_priority(Priority::Optional);
binary.set_description("Hello, world!");
assert_eq!(control.to_string(), r#"Source: hello
Section: rust
Package: hello
Architecture: amd64
Priority: optional
Description: Hello, world!
"#);