We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf244ff commit c152ff5Copy full SHA for c152ff5
src/rule/string/email.rs
@@ -3,6 +3,18 @@ use crate::rule::Rule;
3
use crate::Refined;
4
use regex::Regex;
5
6
+/// The `Email` type represents a type that conforms to the format of an Email.
7
+///
8
+/// # Example
9
+/// ```rust
10
+/// # use refined_type::rule::Email;
11
12
+/// let valid = "[email protected]".to_string();
13
+/// assert!(Email::new(valid).is_ok());
14
15
+/// let invalid = "example.com".to_string();
16
+/// assert!(Email::new(invalid).is_err());
17
+/// ```
18
pub type Email = Refined<EmailRule>;
19
20
pub struct EmailRule;
0 commit comments