Support Arbitrary for `any` types
greyblake opened this issue · comments
Serhii Potapov commented
Specs
- Add
ArbitraryArbitrary
variant toAnyDeriveTrait
enum. - Adjust
to_any_derive_trait()
validation function to returnAnyDeriveTrait::ArbitraryArbitrary
- Add module
nutype_macros/src/any/gen/traits/arbitrary.rs
- Implement there a derive of
::arbitrary::Arbitrary
crate- If type has custom validation set with
predicate =
, then it should return a compile error, saying that derive of Arbitrary is not possible - If inner type implements
Arbitrary
it should work (though, it's not possible to know at the compile time if the inner type implements Arbitrary`
- If type has custom validation set with
- Create a new example in
any_arbitrary
that demos derive ofArbitrary
. Seeinteger_arbitrary
for example.