Crates.io | libcoerced |
lib.rs | libcoerced |
version | 0.1.2 |
source | src |
created_at | 2024-08-18 03:55:25.252087 |
updated_at | 2024-08-18 18:49:12.553816 |
description | A library for serde_json and generic text content matching, verification and coercion. |
homepage | https://lest.crit.rip |
repository | https://git.crit.rip/lest-rs/libcoerced |
max_upload_size | |
id | 1342309 |
size | 8,779 |
libcoerced
provides reasonably advanced json/text matching and coercion for Rust.
It's simple to use and uses serde_json
under the hood.
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));
use libcoerced::generic::Text;
let text = "hello";
let op = Text::Equals("hello");
assert!(generic::text_verify(&op, text));