Expand description
Fast parser for deb822 format.
This parser is lossy in the sense that it will discard whitespace and comments in the input.
§API Variants
This crate provides two parsing APIs:
§Owned API (default)
The main API using Deb822, Paragraph, and Field types that own their data.
- Easy to use - no lifetime management required
- Can be stored, moved, and outlive the source string
- Good performance with moderate allocations
§Borrowed API (low-allocation)
The borrowed module provides a low-allocation API using borrowed string slices.
- Maximum performance - avoids allocating owned Strings for field data
- Still allocates Vec structures for paragraphs and fields
- Requires lifetime management
- Data cannot outlive the source string
- Best for parsing large files where you process data immediately
use deb822_fast::{Deb822, borrowed::BorrowedParser};
let input = "Package: hello\nVersion: 1.0\n";
// Owned API - easy to use
let doc: Deb822 = input.parse().unwrap();
let package = doc.iter().next().unwrap().get("Package");
// Borrowed API - maximum performance
let paragraphs = BorrowedParser::new(input).parse_all().unwrap();
let package = paragraphs[0].get("Package");Re-exports§
pub use convert::FromDeb822Paragraph;pub use convert::ToDeb822Paragraph;
Modules§
- borrowed
- Low-allocation borrowed API for deb822 parsing.
- convert
- Conversion between Deb822-like paragraphs and Rust objects.
Structs§
- Deb822
- A deb822 document.
- Field
- A field in a deb822 paragraph.
- Paragraph
- A deb822 paragraph.
- Paragraph
Reader - Reader that streams paragraphs from a buffered reader.
Enums§
- Error
- Error type for the parser.
Constants§
- BINARY_
FIELD_ ORDER - Canonical field order for binary packages in debian/control files
- SOURCE_
FIELD_ ORDER - Canonical field order for source paragraphs in debian/control files