You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently we have the Schematic derived macro to mark it can be described as a Parameter, but we wanna introduce a integrated way to validate the value coming from user input.
like the email must be match the email regex, like #[validation(regex="[a-zA-Z]+@[a-z]{2}.com")] , like the number must be in the range of 0-100 :#[validation(min=0, max=100)]
so it means that we need to inject into the trait FromRequest. add a new trait called Validator and then impl Validator for MyStruct then impl FromRequest for T where T: Validator
The text was updated successfully, but these errors were encountered:
currently we have the
Schematic
derived macro to mark it can be described as a Parameter, but we wanna introduce a integrated way to validate the value coming from user input.like the email must be match the email regex, like
#[validation(regex="[a-zA-Z]+@[a-z]{2}.com")]
, like the number must be in the range of 0-100 :#[validation(min=0, max=100)]
so it means that we need to inject into the trait
FromRequest
. add a new trait calledValidator
and thenimpl Validator for MyStruct
thenimpl FromRequest for T where T: Validator
The text was updated successfully, but these errors were encountered: