diff options
| author | Bastien Orivel | 2017-09-26 12:46:37 +0200 |
|---|---|---|
| committer | Bastien Orivel | 2017-09-27 16:00:59 +0200 |
| commit | f50f890bb1d41449e22fc06dedf5594ab7ddc2e4 (patch) | |
| tree | 02655c187c63de905658944e089a250acb5c130d /README.md | |
| parent | 4d7138e040cd5faaf84448a75b64f3ff0e4673e5 (diff) | |
| download | validator-f50f890bb1d41449e22fc06dedf5594ab7ddc2e4.tar.bz2 | |
Add a credit card number validator
Instead of using our own algorithm, I chose to use rs-card-validator.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -151,6 +151,16 @@ Examples: #[validate(regex = "ALLOWED_USERNAMES_RE"))] ``` +### credit\_card +Test whetever the string is a valid credit card number. To use this validator, +you must enable the `credit_cards` feature for the `validator` crate. + +Examples: + +```rust +#[validate(credit_card)] +``` + ### custom Calls one of your function to do a custom validation. The field will be given as parameter and it should return a `Option<String>` representing the error code, |
