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
//! Email addresses: split at the `@`, checked, made canonical per mail
//! provider, and their domains classified as free or disposable.
//!
//! | PHP | Rust |
//! |---|---|
//! | `Utopia\Emails\Email` | [`Email`] |
//! | `new Email($email)` | [`Email::new`] |
//! | `get()`, `getLocal()`, `getDomain()` | [`Email::get`], [`Email::local`], [`Email::domain`] |
//! | `isValid()`, `hasValidLocal()` | [`Email::is_valid`], [`Email::has_valid_local`] |
//! | `hasValidDomain()` | [`Email::has_valid_domain_syntax`], then the domain's known suffix (`utopia-domains`) |
//! | `isDisposable()`, `isFree()` | [`Lists::is_disposable`], [`Lists::is_on_free_list`] (`isFree()` also needs it not disposable) |
//! | `getCanonical()`, `isCanonicalSupported()`, `getCanonicalDomain()` | [`Email::canonical`], [`Email::is_canonical_supported`], [`Email::canonical_domain`] |
//! | `Email::LOCAL_MAX_LENGTH`, `DOMAIN_MAX_LENGTH` | [`LOCAL_MAX_LENGTH`], [`DOMAIN_MAX_LENGTH`] |
//! | `data/free-domains.php`, `data/disposable-domains.php` | [`Lists`] ([`Lists::FREE`], [`Lists::DISPOSABLE`]) |
//! | `Canonicals\Providers\{Gmail, Outlook, Yahoo, Icloud, Protonmail, Fastmail, Walla, Generic}` | [`Provider`] ([`PROVIDERS`], [`Provider::GENERIC`]) |
//!
//! What `Email` asks of its domain (`getProvider()`, `getSubdomain()`,
//! `isKnown()`) is `Utopia\Domains\Domain`'s, which the extension calls
//! as PHP does, so this crate does not parse domains.
//!
//! The lists are embedded in the crate (`data/*-domains.txt`, exported from
//! the PHP package's `data/*-domains.php` by `data/export.php`) with hash
//! tables of their lines built at compile time (`build.rs`), so a lookup
//! allocates nothing and both live in the library's read-only pages, shared by
//! every process. The PHP validators, providers and import task are not
//! ported: `Email` is.
pub use ;
pub use ;
pub use Error;
pub use ;
/// The README, compiled and run with the doctests.
;