alpm-parsers

Crates.ioalpm-parsers
lib.rsalpm-parsers
version0.2.0
created_at2025-02-28 17:19:40.43101+00
updated_at2025-06-16 12:41:36.895306+00
descriptionVarious parsers for parsing Arch Linux package formats
homepagehttps://gitlab.archlinux.org/archlinux/alpm/alpm
repositoryhttps://gitlab.archlinux.org/archlinux/alpm/alpm
max_upload_size
id1573015
size48,412
Arch Linux Technical User (archlinux-github)

documentation

README

alpm-parsers

A library for providing various custom parsers/deserializers for the specifications used in Arch Linux Package Management (ALPM).

Documentation

Examples

Custom INI parser

use serde::Deserialize;

const DATA: &str = "
num = 42
text = foo
list = bar
list = baz
list = qux
";

#[derive(Debug, Deserialize)]
struct Data {
    num: u64,
    text: String,
    list: Vec<String>,
}

fn main() {
    let data: Data = alpm_parsers::custom_ini::from_str(DATA).unwrap();
}

The main difference between the regular INI parser and this one is that it allows duplicate keys in a section and collects them into a Vec.

Furthermore, the delimiter must be a =, which is much more rigid than classic ini, as that allows to not use surrounding whitespaces or even other characters as delimiters.

Note: Serde's flatten attribute is currently not supported. See this issue for more details.

Features

  • winnow-debug enables the winnow/debug feature, which shows the exact parsing process of winnow.

Contributing

Please refer to the contribution guidelines to learn how to contribute to this project.

License

This project can be used under the terms of the Apache-2.0 or MIT. Contributions to this project, unless noted otherwise, are automatically licensed under the terms of both of those licenses.

Commit count: 0

cargo fmt