Crates.io | serdeval |
lib.rs | serdeval |
version | 0.1.0 |
source | src |
created_at | 2021-07-29 13:53:28.850666 |
updated_at | 2021-07-29 13:53:28.850666 |
description | Serde dummy types for fast and memory efficient typed validation. |
homepage | |
repository | https://github.com/MarinPostma/serdeval |
max_upload_size | |
id | 428805 |
size | 920,601 |
A serde validator
SerdeVal allows you to validate data that can be deserialized using serde, whithout actually deserializing to anything. This is usefull when you only want to validate that some data can be deserialized to some type. SerdeVal doesn't allocate anything, so it is extremely efficient for validating large files from disk:
use std::io::File;
use serdeval::*;
// we want to check that the very_big.json is an arrray of javascript objects:
fn main() {
let json = File::open("very_big.json").unwrap();
let _: Seq<Map<Str, Any>> = serde_json::from_reader(json).unwarp();
}