1
1
Fork
You've already forked vdf-reader
1
A parser for VDF
  • Rust 99.6%
  • Nix 0.4%
Robin Appelman 97ee910d85
Some checks failed
CI / semver (push) Failing after 32s
CI / checks (push) Successful in 1m44s
updates
2026年07月11日 21:18:49 +02:00
.forgejo/workflows workflow updates 2025年06月02日 19:53:42 +02:00
examples add support for deserializing a map with int keys as a sequence 2025年06月05日 22:17:30 +02:00
src updates 2026年07月11日 21:18:49 +02:00
tests updates 2026年07月11日 21:18:49 +02:00
.envrc init 2023年12月15日 15:51:53 +01:00
.gitignore statements 2023年12月15日 16:26:16 +01:00
app.vdf move to serde_core 2025年10月22日 21:46:43 +02:00
Cargo.lock updates 2026年07月11日 21:18:49 +02:00
Cargo.toml updates 2026年07月11日 21:18:49 +02:00
flake.lock updates 2026年07月11日 21:18:49 +02:00
flake.nix updates 2026年07月11日 21:18:49 +02:00
LICENSE add LICENSE file 2026年03月29日 15:45:07 +02:00
README.md typo 2026年03月29日 15:45:48 +02:00

vdf-reader

A parser for Valve's Data Format v1 (VDF) also known as KeyValues.

The parser focuses on being able to deal with all the various weird forms vdf takes in the wild and providing access to the data stream instead of always requiring parsing the file in full.

Serde

This crate implements a deserializer for serde, but because VDF doesn't map that well onto the serde data model not every type might deserialize properly.

Limitations

  • Because the boolean values 0 and 1 can't be distinguished from numbers, it is not possible to use booleans in untagged enums.

  • When deserializing arrays by setting the same key multiple times, the keys have to be consecutive.

    key: 1
    key: 2
    other: 3
    

    will work, but

    key: 1
    other: 3
    key: 2
    

    will not.

Tagged enum root

To help deserialize some common vdf formats, you can use a tagged enum as the root element instead of a struct.

"Variant1" {
 content 1
}

or

"Variant2" {
 other foo
}

can be deserialized into a

enum Data{Variant1{content: bool,},Variant2{other: String,}}