1 unstable release
Uses new Rust 2024
| new 0.1.0 | May 15, 2026 |
|---|
#2877 in Encoding
17KB
252 lines
use-data
Feature-gated umbrella crate for the RustUse structured data helpers.
Warning: versions below
0.3.0are experimental and may change as the workspace matures.
Example Usage
[dependencies]
use-data = { version = "0.1", default-features = false, features = ["json", "toml"] }
#[cfg(all(feature = "json", feature = "toml"))]
use use_data::json::{JsonKind, detect_json_kind};
#[cfg(all(feature = "json", feature = "toml"))]
use use_data::toml::extract_toml_tables;
#[cfg(all(feature = "json", feature = "toml"))]
let kind = detect_json_kind("{\"ok\":true}");
#[cfg(all(feature = "json", feature = "toml"))]
let tables = extract_toml_tables("[package]\nname = \"use-data\"\n");
#[cfg(all(feature = "json", feature = "toml"))]
assert_eq!(kind, JsonKind::Object);
#[cfg(all(feature = "json", feature = "toml"))]
assert_eq!(tables[0].name, "package");
Scope
- opt-in access to the focused
use-json,use-toml,use-yaml,use-csv, anduse-xmlcrates - a small facade surface that does not force unused format helpers into downstream builds
- lightweight composition across RustUse docs tooling, CLIs, fixtures, and scaffolding code
Non-Goals
- adding behavior beyond the child crates
- a single parser abstraction over unrelated data formats
- replacing dedicated parser or serialization ecosystems
License
Licensed under either of the following, at your option:
- MIT License
- Apache License, Version 2.0