#validation #run-time #boilerplate #require #loaded #generate #deserialize

yanked validation-boilerplate

Utility for generating boilerplate for types that require runtime validation whenever they are loaded

1 unstable release

0.1.0 Jun 27, 2024

#15 in #loaded

MIT license

5KB

Validation Boilerplate

Utility for generating boilerplate for types that require runtime validation whenever they are loaded.

This generates a private type that uses derive(Deserialize) as normal then passes it to a validation function to be converted to the user type.

It can be applied recursively and is compatable with any type that implements deserialize normally.


lib.rs:

A trait for a type that should be compatable with serde Deserialize but requires validation to be enforced recursively.

Dependencies

~0.8–1.4MB
~28K SLoC