1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! A disposable email checker utilizing a [Bloom filter](https://en.wikipedia.org/wiki/Bloom_filter).
//!
//! * Lightweight
//! * Probabilistic
//! * Blazingly fast 🚀
//! * Backed by [mailchecker's](https://github.com/FGRibreau/mailchecker) email blacklist
//!
//! # Usage
//!
//! ```toml
//! [dependencies]
//! dispo = "0.1.0"
//! ```
//!
//! ```rust
//! let x = dispo::is_valid("alice@example.com");
//! assert_eq!(x, true);
//!
//! let x = dispo::is_valid_domain("tempmail.de");
//! assert_eq!(x, false);
//! ```
use EmailAddress;
use FromStr;
include!;
/// Returns `true` if the email has a valid format and is not disposable.
///
/// # Examples
///
/// ```
/// let x = dispo::is_valid("alice@example.com");
/// assert_eq!(x, true);
///
/// let x = dispo::is_valid("alice@tempmail.de");
/// assert_eq!(x, false);
///
/// let x = dispo::is_valid("alice.example.com");
/// assert_eq!(x, false);
/// ```
/// Returns `true` if the domain is not disposable, doesn't
/// check if the domain itself has a valid format.
///
/// # Examples
///
/// ```
/// let x = dispo::is_valid_domain("example.com");
/// assert_eq!(x, true);
///
/// let x = dispo::is_valid_domain("tempmail.de");
/// assert_eq!(x, false);
///
/// let x = dispo::is_valid_domain("tempmail");
/// assert_eq!(x, true);
/// ```