aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorVincent Prouillet2017-01-18 00:29:23 +0900
committerVincent Prouillet2017-01-18 00:30:44 +0900
commit32ada012eb1de7da60d979b65844d008fc75b458 (patch)
tree6fa876cff0dc3689a4421f2a5d151be2096173be /README.md
parentd8298ba2c96692cf4fb954393afb9fe10cb31b4c (diff)
downloadvalidator-32ada012eb1de7da60d979b65844d008fc75b458.tar.bz2
Add contains validator
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index e99a54f..37946ee 100644
--- a/README.md
+++ b/README.md
@@ -112,6 +112,16 @@ Examples:
#[validate(must_match = "password2"))]
```
+### contains
+Tests whether the string contains the substring given or if a key is present in a hashmap. `contains` takes
+1 string argument.
+
+Examples:
+
+```rust
+#[validate(contains = "gmail"))]
+```
+
### 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,