kvf
A minimal, spec-compliant Rust parser library for Kv Format 1.0.
About Kv Format
Kv Format is a minimal key-value file format designed for simplicity and correctness. This crate implements a parser fully compliant with the Kv Format 1.0 RC1 specification.
For full details on the format's syntax, error handling, and design rationale, see kvformat.org.
Add to your project
[]
= "0.1.0"
Eager parsing
use ;
Streaming parsing
use ;
Custom configuration
use ;
Error types
All errors implement std::fmt::Display and std::error::Error.
Error variants correspond to the error codes defined in
Appendix B of the Kv Format 1.0 specification:
| Variant | Appendix B | Description |
|---|---|---|
BomError |
B.1 | Input starts with UTF-8 BOM (EF BB BF) |
InvalidUtf8Error { line } |
B.2 | Invalid UTF-8 byte sequence |
InvalidCharacterError { line } |
B.3 | Standalone CR or NUL character |
EmptyKeyError { line } |
B.4 | Line starts with = (empty key) |
MissingOperatorError { line } |
B.5 | Data line without = operator |
InvalidKeyError { line } |
B.6 | Key doesn't match [A-Za-z_][A-Za-z0-9_]* |
MissingFinalEolError |
B.7 | Final line not terminated by LF or CRLF |
License
Licensed under either of Apache License, Version 2.0 or MIT license, at your option.