Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

Crate use_data

Crate use_data 

Source
Expand description

§use-data

Feature-gated umbrella crate for the RustUse structured data helpers.

Warning: versions below 0.3.0 are 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, and use-xml crates
  • 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

Re-exports§

pub use use_csv as csv;
pub use use_json as json;
pub use use_toml as toml;
pub use use_xml as xml;
pub use use_yaml as yaml;