use vts::vts; vts! { #[derive(Debug, Clone, PartialEq, Eq, Hash)] type NonZeroInt = u32 where self.0 > 0; type NoConstraint = String; } vts! { type NoType; } #[test] fn test_1() { assert!(matches!(NonZeroInt::new(0), Err(NonZeroIntConstraintError))); assert!(matches!(NonZeroInt::new(1), Ok(_))); }