crosvm/serde_keyvalue/Cargo.toml
Mike Gerow b53a156fbc serde_keyvalue: parse hex, octal, and binary nums
This adds support for parsing hex `m=0x1234abcd` octal `0o755` and
binary `m=0o1100` values according the their prefix. Negative numbers
can also be specified by adding a `-` after the prefix.

Note that negative values like `m=-0x1234` don't work, largely as an
artifact of the way the Num trait works. This could probably be fixed,
but given hex, octal, and binary numbers tend to be used in unsigned
situations most of the time this shouldn't be an issue.

The main motivation for this is the debugcon serial device, which
accepts an argument which is an x86 IO port. These are much more
naturally described in hex.

BUG=b:233610263

Change-Id: Ic68bacd772de6aebfaad0de7b8aa6faf5d4c1555
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3671595
Commit-Queue: Mike Gerow <gerow@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-06-02 22:03:20 +00:00

19 lines
453 B
TOML

[package]
name = "serde_keyvalue"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2021"
[features]
argh_derive = ["argh", "serde_keyvalue_derive"]
[dependencies]
argh = { version = "0.1.7", optional = true }
serde_keyvalue_derive = { path = "serde_keyvalue_derive", optional = true }
serde = "1"
thiserror = { version = "1.0.20" }
remain = "*"
num-traits = "0.2"
[dev-dependencies]
serde = { version = "1", features = ["derive"] }