2 unstable releases
0.2.4 | Dec 31, 2023 |
---|---|
0.1.0 | Dec 31, 2023 |
#227 in Email
13KB
216 lines
verust
Library for data validation in Rust.
It provides validation functions for:
- Email addresses
- URLs
- Phone numbers
- Passwords
Installation
You can include verust
library to your project, by adding following to your Cargo.toml
:
[dependencies]
verust = "0.1.0"
And then do a cargo build:
cargo build
Usage
First, include the verust
in your Rust file:
extern crate verust;
Then you can use the validation functions in your code as follows:
For email validation:
if verust::email::validate("example@example.com") {
println!("Valid email!");
} else {
println!("Invalid email.");
}
For URL validation:
if verust::url::validate("https://example.com") {
println!("Valid URL!");
} else {
println!("Invalid URL.");
}
And alike for other types of validation.
License
verust
is distributed under the MIT license. See LICENSE
file for additional information.
Dependencies
~2–3MB
~54K SLoC