Contents
use utopia_emails::Canonical;pub struct Canonical {
pub local: Vec<u8>,
pub domain: Vec<u8>,
}The canonical form of an address: its local part and domain with a provider's aliases removed.
PHP: the array ['local' => ..., 'domain' => ...] of getCanonical().
use utopia_emails::DomainList;pub struct DomainList {
// private fields
}A set of domains, matched as PHP's in_array($domain, $list): a loose
comparison, so numeric strings compare as numbers ("1e3" matches an
entry "1000").
Default, FromIterator<&'a str>.use utopia_emails::Email;pub struct Email {
// private fields
}An address: trimmed, lower-cased (mb_strtolower) and split at its
single @. It can hold any bytes, as a PHP string does.
use utopia_emails::Lists;pub struct Lists {
pub free: DomainList,
pub disposable: DomainList,
}The free and disposable domain lists.
use utopia_emails::Provider;pub struct Provider {
pub canonical_domain: &'static str,
pub domains: &'static [&'static str],
// private fields
}A mail provider's aliasing rules.
use utopia_emails::Error;pub enum Error {
Parse(Vec<u8>),
EmptyLocal,
}Why an address could not be parsed or made canonical.
pub const DOMAIN_MAX_LENGTH: usize = 253usize;The most characters allowed after the @.
PHP: Email::DOMAIN_MAX_LENGTH.
pub const LOCAL_MAX_LENGTH: usize = 64usize;The most characters allowed before the @.
PHP: Email::LOCAL_MAX_LENGTH.
pub static PROVIDERS: &[Provider];The providers Email consults, in order.
PHP: Email::initializeProviders(); Yandex is not among them.