mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
4fea399df9
crosvm is switching the import style to use one import per line. While more verbose, this will greatly reduce the occurence of merge conflicts going forward. Note: This is using a nightly feature of rustfmt. So it's a one-off re-format only. We are considering adding a nightly toolchain to enable the feature permanently. BUG=b:239937122 TEST=CQ Change-Id: Id2dd4dbdc0adfc4f8f3dd1d09da1daafa2a39992 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3784345 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Dennis Kempin <denniskempin@google.com> Commit-Queue: Dennis Kempin <denniskempin@google.com> |
||
---|---|---|
.. | ||
serde_keyvalue_derive | ||
src | ||
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.