crosvm/serde_keyvalue
Alexandre Courbot 7468fa4f91 serde_keyvalue: export KeyValueDeserializer
We will need to control deserialization from a lower-level in order to
remove the `flatten` attribute from the VhostUserParams struct, so make
the KeyValueDeserializer interface available publicly.

BUG=b:217480043
TEST=cargo build

Change-Id: I366a71ef1b4f38ba4673478dc7ae8b928a8f57d3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3889328
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-09-15 02:07:56 +00:00
..
serde_keyvalue_derive Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
src serde_keyvalue: export KeyValueDeserializer 2022-09-15 02:07:56 +00:00
Cargo.toml serde_keyvalue: use nom crate for parsing 2022-08-24 00:37:59 +00:00
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.