crosvm/serde_keyvalue
Alexandre Courbot 824a7938b2 serde_keyvalue: add tests for outer-braces in arguments
Although our arguments are a struct, specifying braces for it should not
be allowed. Add tests to enforce that.

BUG=None
TEST=cargo test -p serde_keyvalue

Change-Id: Ic4e731999269895e0c4a65e66cd338500c520451
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4600499
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
2023-06-09 04:59:54 +00:00
..
serde_keyvalue_derive
src serde_keyvalue: add tests for outer-braces in arguments 2023-06-09 04:59:54 +00:00
Cargo.toml
README.md

Serde deserializer from key=value strings

A lightweight serde deserializer for strings containing key-value pairs separated by commas, as commonly found in command-line parameters.

Say your program takes a command-line option of the form:

--foo type=bar,active,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.

Integration with the argh command-line parser is also provided via the argh_derive feature.

See the inline documentation for examples and more details.