| Crates.io | serde-keyvalue-prim |
| lib.rs | serde-keyvalue-prim |
| version | 0.1.2 |
| created_at | 2026-01-04 01:39:33.248615+00 |
| updated_at | 2026-01-09 18:25:18.84572+00 |
| description | Deserialize key=value parameters with serde, supporting multiple delimiters, both key=value and key:value separated by either , or ;. |
| homepage | |
| repository | https://github.com/simonsso/serde-keyvalue-prim |
| max_upload_size | |
| id | 2021143 |
| size | 81,375 |
A lightweight serde deserializer for strings containing key-value pairs separated by commas, as commonly found in command-line parameters or colon and semicolons as in simple line-based communication protocols.
Say your program takes a command-line option of the form:
--foo type=bar,active,nb_threads=8
or you need to parse a configuration string like:
type:bar;active:99;nb_threads=8
This crate provides a [from_key_values] function that deserializes these key-values into a configuration structure. Since it uses serde, the same configuration structure can also be created from any other supported source (such as a TOML or YAML configuration file) that uses the same keys.
The deserializer supports parsing signed and unsigned integers, booleans, strings (quoted or not), paths, and enums inside a top-level struct. The order in which the fields appear in the string is not important.
See also, source code documentation crates io
This project was forked from and source then modified to support multiple delimiters.