use-json 0.1.0

Lightweight JSON inspection and formatting helpers for RustUse
Documentation
  • Coverage
  • 66.67%
    14 out of 21 items documented1 out of 14 items with examples
  • Size
  • Source code size: 10.94 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 379.99 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-json

Practical JSON utility primitives for lightweight inspection, detection, quoting, and formatting.

Warning: versions below 0.3.0 are experimental and may change as the crate matures.

Example Usage

use use_json::{JsonKind, compact_json_basic, detect_json_kind, quote_json_string};

let compact = compact_json_basic("{ \"ok\": true, \"name\": \"RustUse\" }");
let quoted = quote_json_string("line\nbreak");

assert_eq!(compact, "{\"ok\":true,\"name\":\"RustUse\"}");
assert_eq!(quoted, "\"line\\nbreak\"");
assert_eq!(detect_json_kind("[1, 2, 3]"), JsonKind::Array);

Scope

  • small JSON shape and primitive detection helpers
  • conservative quoting and escaping helpers for strings
  • whitespace compaction that preserves content inside JSON strings

Non-Goals

  • a full JSON parser
  • JSONPath support
  • schema validation
  • a replacement for serde_json

License

Licensed under either of the following, at your option:

  • MIT License
  • Apache License, Version 2.0