| 12 | mod regex; |
| 13 | |
| 14 | pub trait Validator: Send + Sync + Any { |
| 15 | fn name(&self) -> &'static str; |
| 16 | fn validate(&self, value: &Value) -> Result<(), String>; |
| 17 | fn as_any(&self) -> &dyn Any; |
| 18 | fn downcast_ref<U: Any>(&self) -> Option<&U> |
| 19 | where |
| 20 | Self: Sized, |
| 21 | { |
| 22 | self.as_any().downcast_ref::<U>() |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | // Nighly feature gate required |
| 27 | // impl dyn Validator { |
nothing calls this directly
no outgoing calls
no test coverage detected