libcoerced 0.1.2

A library for serde_json and generic text content matching, verification and coercion.
Documentation
  • Coverage
  • 66.67%
    16 out of 24 items documented0 out of 4 items with examples
  • Size
  • Source code size: 8.77 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 278.32 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • microcrit

libcoerced

libcoerced provides reasonably advanced json/text matching and coercion for Rust.
It's simple to use and uses serde_json under the hood.

Example

JSON Verification

use libcoerced::json;

let json = json::Json::Object(Box::new([
    ("hello", Box::new(
        json::Json::StringLiteral("world")
    ))
]));
let data = serde_json::json!({
    "hello": "world"
});
assert!(json::json_verify(Box::new(json), data));

Text Verification

use libcoerced::generic::Text;

let text = "hello";
let op = Text::Equals("hello");
assert!(generic::text_verify(&op, text));