is_valid_email
Checks a pragmatic subset of RFC 5322 that catches real typos, not a full grammar.
Requires exactly one @, a non-empty local part of ASCII letters, digits and . _ % + -
with no leading, trailing or doubled dot, and a domain of at least two dot-separated labels
(ASCII letters, digits and hyphens, none starting or ending with a hyphen) whose last label
is letters only. Quoted local parts, comments and internationalized domain names are not
supported: this is meant to reject obvious mistakes, not to be the final word on deliverability.
Import
Section titled “Import”Cargo feature validate (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
s | &str | The address to check. |
Returns
Section titled “Returns”bool — true when s passes the checks above.
